isci: fix a build warning
authorDan Williams <dan.j.williams@intel.com>
Fri, 25 Mar 2011 17:05:58 +0000 (10:05 -0700)
committerDan Williams <dan.j.williams@intel.com>
Sun, 3 Jul 2011 11:00:36 +0000 (04:00 -0700)
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>
drivers/scsi/isci/probe_roms.c

index 1697487f908c6af017cc7eb19cc6def2569c4d54..2df8d8e5d5eadd2809cfce3de0686a585c533465 100644 (file)
@@ -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);