From: James Bottomley <jejb@linux.vnet.ibm.com>
To: Arnd Bergmann <arnd@arndb.de>,
qla2xxx-upstream@qlogic.com,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Himanshu Madhani <himanshu.madhani@cavium.com>,
Darren Trapp <darren.trapp@cavium.com>,
Giridhar Malavali <giridhar.malavali@cavium.com>,
Duane Grigsby <duane.grigsby@cavium.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] scsi: qla2xxx: remove incorrect byte swap
Date: Fri, 30 Jun 2017 09:41:57 -0700 [thread overview]
Message-ID: <1498840917.8086.3.camel@linux.vnet.ibm.com> (raw)
In-Reply-To: <20170630161056.30630-1-arnd@arndb.de>
On Fri, 2017-06-30 at 18:10 +0200, Arnd Bergmann wrote:
> cont_pkt->entry_type is an 8-bit field, so doing a 32-bit byteswap
> on it will store incorrect data:
>
> drivers/scsi/qla2xxx/qla_nvme.c: In function 'qla2x00_start_nvme_mq':
> include/uapi/linux/byteorder/big_endian.h:32:26: error: large integer
> implicitly truncated to unsigned type [-Werror=overflow]
> drivers/scsi/qla2xxx/qla_nvme.c:444:27: note: in expansion of macro
> 'cpu_to_le32'
> cont_pkt->entry_type = cpu_to_le32(CONTINUE_A64_TYPE);
>
> This removes the erroneous cpu_to_le32().
>
> Fixes: e84067d74301 ("scsi: qla2xxx: Add FC-NVMe F/W initialization
> and transport registration")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> 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;
>
We already have a patch proposed for this, but I think it may be wrong
(it's the same as yours, so yours may be wrong too) see the handling in
qla_iocb.c
James
next prev parent reply other threads:[~2017-06-30 16:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-30 16:10 [PATCH 1/2] scsi: qla2xxx: remove incorrect byte swap Arnd Bergmann
2017-06-30 16:10 ` [PATCH 2/2] scsi: qla2xxx: avoid unused-function warning Arnd Bergmann
2017-06-30 23:54 ` Madhani, Himanshu
2017-07-01 21:15 ` Martin K. Petersen
2017-06-30 16:41 ` James Bottomley [this message]
2017-06-30 17:00 ` [PATCH 1/2] scsi: qla2xxx: remove incorrect byte swap Madhani, Himanshu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1498840917.8086.3.camel@linux.vnet.ibm.com \
--to=jejb@linux.vnet.ibm.com \
--cc=arnd@arndb.de \
--cc=darren.trapp@cavium.com \
--cc=duane.grigsby@cavium.com \
--cc=giridhar.malavali@cavium.com \
--cc=himanshu.madhani@cavium.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=qla2xxx-upstream@qlogic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox