diff mbox

lpfc: fix "integer constant too large" error on 32bit archs

Message ID 1501158782-29604-1-git-send-email-mlombard@redhat.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Maurizio Lombardi July 27, 2017, 12:33 p.m. UTC
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>
---
 drivers/scsi/lpfc/lpfc_init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Martin K. Petersen July 27, 2017, 12:57 p.m. UTC | #1
Maurizio,

> 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>
> ---
>  drivers/scsi/lpfc/lpfc_init.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
> index 491aa95..e992dc1 100644
> --- a/drivers/scsi/lpfc/lpfc_init.c
> +++ b/drivers/scsi/lpfc/lpfc_init.c
> @@ -3710,8 +3710,8 @@
>  	if (phba->sli_rev == LPFC_SLI_REV4)
>  		return be64_to_cpu(wwn);
>  	else
> -		return (((wwn & 0xffffffff00000000) >> 32) |
> -			((wwn & 0x00000000ffffffff) << 32));
> +		return (((wwn & 0xffffffff00000000ULL) >> 32) |
> +			((wwn & 0x00000000ffffffffULL) << 32));

rol64()?
Maurizio Lombardi July 27, 2017, 2:50 p.m. UTC | #2
Dne 27.7.2017 v 14:57 Martin K. Petersen napsal(a):
>> diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
>> index 491aa95..e992dc1 100644
>> --- a/drivers/scsi/lpfc/lpfc_init.c
>> +++ b/drivers/scsi/lpfc/lpfc_init.c
>> @@ -3710,8 +3710,8 @@
>>  	if (phba->sli_rev == LPFC_SLI_REV4)
>>  		return be64_to_cpu(wwn);
>>  	else
>> -		return (((wwn & 0xffffffff00000000) >> 32) |
>> -			((wwn & 0x00000000ffffffff) << 32));
>> +		return (((wwn & 0xffffffff00000000ULL) >> 32) |
>> +			((wwn & 0x00000000ffffffffULL) << 32));
> 
> rol64()?
> 

Right,

I will send a new version.
Maurizio
diff mbox

Patch

diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 491aa95..e992dc1 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -3710,8 +3710,8 @@ 
 	if (phba->sli_rev == LPFC_SLI_REV4)
 		return be64_to_cpu(wwn);
 	else
-		return (((wwn & 0xffffffff00000000) >> 32) |
-			((wwn & 0x00000000ffffffff) << 32));
+		return (((wwn & 0xffffffff00000000ULL) >> 32) |
+			((wwn & 0x00000000ffffffffULL) << 32));
 
 }