scsi: lpfc: fix "integer constant too large" error on 32bit archs
authorMaurizio Lombardi <mlombard@redhat.com>
Wed, 23 Aug 2017 23:55:48 +0000 (16:55 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 25 Aug 2017 02:29:44 +0000 (22:29 -0400)
cc1: warnings being treated as errors
drivers/scsi/lpfc/lpfc_init.c: In function 'lpfc_get_wwpn':
drivers/scsi/lpfc/lpfc_init.c:3253: error: integer constant is too large for 'long' type

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_init.c

index 1b81f734e3ef3a0e31cb041ad02a68361433009d..7e7ae786121b6e8458f7a7aa8954141c77e223a5 100644 (file)
@@ -37,6 +37,7 @@
 #include <linux/miscdevice.h>
 #include <linux/percpu.h>
 #include <linux/msi.h>
+#include <linux/bitops.h>
 
 #include <scsi/scsi.h>
 #include <scsi/scsi_device.h>
@@ -3728,9 +3729,7 @@ lpfc_get_wwpn(struct lpfc_hba *phba)
        if (phba->sli_rev == LPFC_SLI_REV4)
                return be64_to_cpu(wwn);
        else
-               return (((wwn & 0xffffffff00000000) >> 32) |
-                       ((wwn & 0x00000000ffffffff) << 32));
-
+               return rol64(wwn, 32);
 }
 
 /**