All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] qla2xxx: Fix compile warning
@ 2017-06-28 22:00 Himanshu Madhani
  2017-06-28 22:12 ` James Bottomley
  0 siblings, 1 reply; 7+ messages in thread
From: Himanshu Madhani @ 2017-06-28 22:00 UTC (permalink / raw)
  To: martin.petersen; +Cc: himanshu.madhani, linux-scsi

Fixes following warning

drivers/scsi/qla2xxx/qla_nvme.c: In function 'qla2x00_start_nvme_mq':
include/uapi/linux/byteorder/big_endian.h:32:26: warning: large integer
implicitly truncated to unsigned type [-Woverflow]
 #define __cpu_to_le32(x) ((__force __le32)__swab32((x)))

Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
---
 drivers/scsi/qla2xxx/qla_nvme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c
index 1da8fa8f641d..14e25e32e622 100644
--- a/drivers/scsi/qla2xxx/qla_nvme.c
+++ b/drivers/scsi/qla2xxx/qla_nvme.c
@@ -441,7 +441,7 @@ static int qla2x00_start_nvme_mq(srb_t *sp)
 				req->ring_ptr++;
 			}
 			cont_pkt = (cont_a64_entry_t *)req->ring_ptr;
-			cont_pkt->entry_type = cpu_to_le32(CONTINUE_A64_TYPE);
+			cont_pkt->entry_type = CONTINUE_A64_TYPE;
 
 			cur_dsd = (uint32_t *)cont_pkt->dseg_0_address;
 			avail_dsds = 5;
-- 
2.13.1.452.g97e2ff464

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] qla2xxx: Fix compile warning
  2017-06-28 22:00 [PATCH] qla2xxx: Fix compile warning Himanshu Madhani
@ 2017-06-28 22:12 ` James Bottomley
  2017-06-28 23:03   ` Madhani, Himanshu
  0 siblings, 1 reply; 7+ messages in thread
From: James Bottomley @ 2017-06-28 22:12 UTC (permalink / raw)
  To: Himanshu Madhani, martin.petersen; +Cc: linux-scsi

On Wed, 2017-06-28 at 15:00 -0700, Himanshu Madhani wrote:
> Fixes following warning
> 
> drivers/scsi/qla2xxx/qla_nvme.c: In function 'qla2x00_start_nvme_mq':
> include/uapi/linux/byteorder/big_endian.h:32:26: warning: large
> integer
> implicitly truncated to unsigned type [-Woverflow]
>  #define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
> 
> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
> ---
>  drivers/scsi/qla2xxx/qla_nvme.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_nvme.c
> b/drivers/scsi/qla2xxx/qla_nvme.c
> index 1da8fa8f641d..14e25e32e622 100644
> --- a/drivers/scsi/qla2xxx/qla_nvme.c
> +++ b/drivers/scsi/qla2xxx/qla_nvme.c
> @@ -441,7 +441,7 @@ static int qla2x00_start_nvme_mq(srb_t *sp)
>  				req->ring_ptr++;
>  			}
>  			cont_pkt = (cont_a64_entry_t *)req-
> >ring_ptr;
> -			cont_pkt->entry_type =
> cpu_to_le32(CONTINUE_A64_TYPE);
> +			cont_pkt->entry_type = CONTINUE_A64_TYPE;
> 

Well the code is definitely buggy, because it will load 0 on a BE
system.  However, are you sure this is the right fix?  I thought the
qlogic engine did groups of 32 bit words, which is why the pre-nvme
code loads this field as:

	*((uint32_t *)(&cont_pkt->entry_type)) = cpu_to_le32(CONTINUE_TYPE);

James

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] qla2xxx: Fix compile warning
  2017-06-28 22:12 ` James Bottomley
@ 2017-06-28 23:03   ` Madhani, Himanshu
  0 siblings, 0 replies; 7+ messages in thread
From: Madhani, Himanshu @ 2017-06-28 23:03 UTC (permalink / raw)
  To: James Bottomley; +Cc: martin.petersen, linux-scsi


> On Jun 28, 2017, at 3:12 PM, James Bottomley <James.Bottomley@HansenPartnership.com> wrote:
> 
> On Wed, 2017-06-28 at 15:00 -0700, Himanshu Madhani wrote:
>> Fixes following warning
>> 
>> drivers/scsi/qla2xxx/qla_nvme.c: In function 'qla2x00_start_nvme_mq':
>> include/uapi/linux/byteorder/big_endian.h:32:26: warning: large
>> integer
>> implicitly truncated to unsigned type [-Woverflow]
>>  #define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
>> 
>> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
>> ---
>>  drivers/scsi/qla2xxx/qla_nvme.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/scsi/qla2xxx/qla_nvme.c
>> b/drivers/scsi/qla2xxx/qla_nvme.c
>> index 1da8fa8f641d..14e25e32e622 100644
>> --- a/drivers/scsi/qla2xxx/qla_nvme.c
>> +++ b/drivers/scsi/qla2xxx/qla_nvme.c
>> @@ -441,7 +441,7 @@ static int qla2x00_start_nvme_mq(srb_t *sp)
>>  				req->ring_ptr++;
>>  			}
>>  			cont_pkt = (cont_a64_entry_t *)req-
>>> ring_ptr;
>> -			cont_pkt->entry_type =
>> cpu_to_le32(CONTINUE_A64_TYPE);
>> +			cont_pkt->entry_type = CONTINUE_A64_TYPE;
>>  
> 
> Well the code is definitely buggy, because it will load 0 on a BE
> system.  However, are you sure this is the right fix?  I thought the
> qlogic engine did groups of 32 bit words, which is why the pre-nvme
> code loads this field as:
> 
> 	*((uint32_t *)(&cont_pkt->entry_type)) = cpu_to_le32(CONTINUE_TYPE);
> 
> James

Agree. I need to go back and check which would be right fix. 

Once i’ve confirmed it works on both platform, I’ll send out new patch.

Thanks,
- Himanshu


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] qla2xxx: Fix compile warning
  2017-06-30 23:56 Himanshu Madhani
@ 2017-07-01  0:10 ` James Bottomley
  0 siblings, 0 replies; 7+ messages in thread
From: James Bottomley @ 2017-07-01  0:10 UTC (permalink / raw)
  To: Himanshu Madhani, martin.petersen; +Cc: linux-scsi

OK, the subject is technically true, but to most people "fix compile
warning" means yet another pointless patch.  This patch isn't
pointless, though, is it?  The driver is actually broken on big endian
systems without it, so the subject should probably say this because
it's important for distros triaging whether to backport this fix if
they backport the nvme components.

On Fri, 2017-06-30 at 16:56 -0700, Himanshu Madhani wrote:
> drivers/scsi/qla2xxx/qla_nvme.c: In function 'qla2x00_start_nvme_mq':
> include/uapi/linux/byteorder/big_endian.h:32:26: warning: large
> integer implicitly truncated to unsigned type [-Woverflow]
>  #define __cpu_to_le32(x) ((__force __le32)__swab32((x)))

This text doesn't explain why you've fixed the bug this way.  It has to
do with the 32 byte reads the card does for the mailbox, so you should
explain what the actual problem the compile warning picked up is and
why you fixed it by doing an entire 32 bit write.

Preferably ASAP because the merge window will open on Monday.

James

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] qla2xxx: Fix compile warning
@ 2017-06-30 23:56 Himanshu Madhani
  2017-07-01  0:10 ` James Bottomley
  0 siblings, 1 reply; 7+ messages in thread
From: Himanshu Madhani @ 2017-06-30 23:56 UTC (permalink / raw)
  To: James.Bottomley, martin.petersen; +Cc: himanshu.madhani, linux-scsi

drivers/scsi/qla2xxx/qla_nvme.c: In function 'qla2x00_start_nvme_mq':
include/uapi/linux/byteorder/big_endian.h:32:26: warning: large integer
implicitly truncated to unsigned type [-Woverflow]
 #define __cpu_to_le32(x) ((__force __le32)__swab32((x)))

Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
---
 drivers/scsi/qla2xxx/qla_nvme.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c
index 1da8fa8f641d..367cf8613b15 100644
--- a/drivers/scsi/qla2xxx/qla_nvme.c
+++ b/drivers/scsi/qla2xxx/qla_nvme.c
@@ -441,7 +441,8 @@ static int qla2x00_start_nvme_mq(srb_t *sp)
 				req->ring_ptr++;
 			}
 			cont_pkt = (cont_a64_entry_t *)req->ring_ptr;
-			cont_pkt->entry_type = cpu_to_le32(CONTINUE_A64_TYPE);
+			*((uint32_t *)(&cont_pkt->entry_type)) =
+			    cpu_to_le32(CONTINUE_A64_TYPE);
 
 			cur_dsd = (uint32_t *)cont_pkt->dseg_0_address;
 			avail_dsds = 5;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] qla2xxx: Fix compile warning
  2017-06-06 20:55 Himanshu Madhani
@ 2017-06-13  1:14 ` Martin K. Petersen
  0 siblings, 0 replies; 7+ messages in thread
From: Martin K. Petersen @ 2017-06-13  1:14 UTC (permalink / raw)
  To: Himanshu Madhani; +Cc: martin.petersen, linux-scsi


Himanshu,

> Fixes following 0-day kernel build warnings

Applied to 4.13/scsi-queue. Thank you!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] qla2xxx: Fix compile warning
@ 2017-06-06 20:55 Himanshu Madhani
  2017-06-13  1:14 ` Martin K. Petersen
  0 siblings, 1 reply; 7+ messages in thread
From: Himanshu Madhani @ 2017-06-06 20:55 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, himanshu.madhani

Fixes following 0-day kernel build warnings

drivers/scsi/qla2xxx/qla_init.c:6407:50: warning: format '%lx' expects
argument of type 'long unsigned int', but argument 5 has type 'unsigned
int' [-Wformat=]
drivers/scsi/qla2xxx/qla_init.c:6709:50: warning: format '%lx'
expects argument of type 'long unsigned int', but argument 5 has
type 'unsigned int' [-Wformat=]

Fixes: b95b9452aacf ("scsi: qla2xxx: Fix crash due to mismatch mumber of Q-pair creation for Multi queue")
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@cavium.com>
---
 drivers/scsi/qla2xxx/qla_init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 436968ad4484..730e7fe4344a 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -6404,7 +6404,7 @@ qla24xx_load_risc_flash(scsi_qla_host_t *vha, uint32_t *srisc_addr,
 	    "-> template size %x bytes\n", dlen);
 	if (dlen > risc_size * sizeof(*dcode)) {
 		ql_log(ql_log_warn, vha, 0x0167,
-		    "Failed fwdump template exceeds array by %lx bytes\n",
+		    "Failed fwdump template exceeds array by %zx bytes\n",
 		    (size_t)(dlen - risc_size * sizeof(*dcode)));
 		goto default_template;
 	}
@@ -6706,7 +6706,7 @@ qla24xx_load_risc_blob(scsi_qla_host_t *vha, uint32_t *srisc_addr)
 	    "-> template size %x bytes\n", dlen);
 	if (dlen > risc_size * sizeof(*fwcode)) {
 		ql_log(ql_log_warn, vha, 0x0177,
-		    "Failed fwdump template exceeds array by %lx bytes\n",
+		    "Failed fwdump template exceeds array by %zx bytes\n",
 		    (size_t)(dlen - risc_size * sizeof(*fwcode)));
 		goto default_template;
 	}
-- 
2.12.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-07-01  0:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-28 22:00 [PATCH] qla2xxx: Fix compile warning Himanshu Madhani
2017-06-28 22:12 ` James Bottomley
2017-06-28 23:03   ` Madhani, Himanshu
  -- strict thread matches above, loose matches on Subject: below --
2017-06-30 23:56 Himanshu Madhani
2017-07-01  0:10 ` James Bottomley
2017-06-06 20:55 Himanshu Madhani
2017-06-13  1:14 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.