Skip to content

Commit

Permalink
isci: fix a build warning
Browse files Browse the repository at this point in the history
Use min_t to address:
drivers/scsi/isci/probe_roms.c: In function ‘isci_get_efi_var’:
drivers/scsi/isci/probe_roms.c:241: warning: comparison of distinct pointer types lacks a cast

Reported-by: David Milburn <dmilburn@redhat.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
  • Loading branch information
Dan Williams committed Jul 3, 2011
1 parent 4eefd25 commit 52ae18a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/scsi/isci/probe_roms.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,8 @@ struct isci_orom *isci_get_efi_var(struct pci_dev *pdev)
return NULL;
}

copy_len = min(evar->DataSize,
min(oem_hdr->len - sizeof(*oem_hdr),
sizeof(*rom)));
copy_len = min_t(u16, evar->DataSize,
min_t(u16, oem_hdr->len - sizeof(*oem_hdr), sizeof(*rom)));

memcpy(rom, (char *)evar->Data + sizeof(*oem_hdr), copy_len);

Expand Down

0 comments on commit 52ae18a

Please sign in to comment.