From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751974AbdF3QnD (ORCPT ); Fri, 30 Jun 2017 12:43:03 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:58756 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751918AbdF3QnB (ORCPT ); Fri, 30 Jun 2017 12:43:01 -0400 Subject: Re: [PATCH 1/2] scsi: qla2xxx: remove incorrect byte swap From: James Bottomley To: Arnd Bergmann , qla2xxx-upstream@qlogic.com, "Martin K. Petersen" Cc: Himanshu Madhani , Darren Trapp , Giridhar Malavali , Duane Grigsby , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Date: Fri, 30 Jun 2017 09:41:57 -0700 In-Reply-To: <20170630161056.30630-1-arnd@arndb.de> References: <20170630161056.30630-1-arnd@arndb.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 17063016-0024-0000-0000-000016C2E824 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007298; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000214; SDB=6.00880938; UDB=6.00439210; IPR=6.00661091; BA=6.00005448; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016024; XFM=3.00000015; UTC=2017-06-30 16:42:03 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17063016-0025-0000-0000-00004B9FBFF6 Message-Id: <1498840917.8086.3.camel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-06-30_12:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1706300262 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- >  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