Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755049AbdCTNkz (ORCPT ); Mon, 20 Mar 2017 09:40:55 -0400 Received: from mail-co1nam03on0066.outbound.protection.outlook.com ([104.47.40.66]:4096 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754934AbdCTNkt (ORCPT ); Mon, 20 Mar 2017 09:40:49 -0400 Authentication-Results: arndb.de; dkim=none (message not signed) header.d=none;arndb.de; dmarc=none action=none header.from=cavium.com; Date: Mon, 20 Mar 2017 09:40:30 -0400 (EDT) From: Chad Dupuis X-X-Sender: cdupuis@administrators-macbook-pro.local To: Arnd Bergmann cc: QLogic-Storage-Upstream@cavium.com, "James E.J. Bottomley" , "Martin K. Petersen" , "David S. Miller" , Ram Amrani , Tomer Tayar , "Mintz, Yuval" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] qedf: fix wrong le16 conversion In-Reply-To: <20170320084947.1031363-1-arnd@arndb.de> Message-ID: References: <20170320084947.1031363-1-arnd@arndb.de> User-Agent: Alpine 2.00 (OSX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Originating-IP: [4.15.251.130] X-ClientProxiedBy: BN6PR07CA0018.namprd07.prod.outlook.com (10.173.33.156) To BLUPR0701MB1715.namprd07.prod.outlook.com (10.163.85.141) X-MS-Office365-Filtering-Correlation-Id: 940890cd-24be-4b21-c59f-08d46f96b60a X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BLUPR0701MB1715; X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1715;3:0tMUm/rIm4t8WEDaNKFZo3bz+O7Qipx3vOGnyO8jpX49KiquU8mLxR45h+eF2skBAr2UBqO4IiGwPq/omcYxKbs0pntLSQxthI7GRBP6UH6PlkaCYbupZrIi8Bi4r8LeLSkdwYNI+whpI/5D5VQ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riC9m/5pp2j/6av9mTcYq3Wb6EDxmVw6GRGB1GEzINfII0poFv/In5TPsWo5LB7r7JrOLCGOVVkkA38P+saLQrxnTym6ZuISyFtcKPtuJiM8Ta/4T+UY+4Obu3el+T2tyMUHN4N3Kgg1SHTK9lDEj+8zs8DV54/U833qWdvjY1FAtRoSTqZ6mFFb/dG8/vU7d7O00H1X46v7GzGBzZvGjSCDSxPpGXlPPZ97d+nhcMIcfV6/dZM/h1rQuIC3X0uj8eTkpWuoJrhoSRqVrLtSbza97UD5dFug7/rravrXYhwZSX5ibdER+WTeUJxZ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(20161123555025)(20161123560025)(20161123558025)(20161123564025)(20161123562025)(6072148);SRVR:BLUPR0701MB1715;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0701MB1715; X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1715;4:f5x/oCVm9+BgVYDnCrRViW+XgJdtx/H9/gjddIRKmI/bo0zKoV1tPw8EX4WUOUoNULhoFtreF0KbWpA3rULPTGgueYOvOOmESDltnkbRNOf+jZIL1Bn8bsioJun4MvfVD5uO2n8KRo5WRbvfj887ixlcea0WBVs+GwcqbW+AaNAUTnItuMEKFqDuKftQQ+8g0Qp4AQ+vrrxDXOJGpn92itLEAyNMItAlDG6A37t3uNOOUdSHsh+1xCdNUPyVWUCV3OPbRcvTZaNLNUZgtH4Z1b3FqHZBAPjOyLkqys5ToJDRkVDpoAGQ7KAjb1KX9voDQ+iGt07Y9J3hnM6uAT4v3I4dSPObIZCms+F8i9XhSPnFKubzOy/tm7e60j8z2exYZCE2IqNvrLqJ3ovBL4rUqpwSY8ti4Rvms3VlV1Lbpq6YoBvuY27FeQnyJiH0FFnm+z/1TEbxVho59wl2Q8DJavTgUm/jLOFtlm9wtpVv7oqusjp6W8KMUdkWnJu9eOY8b/Apy+eyDq/Z0mGBJ+Fj3s2gRtNyLqHCMu7JFa1DOsinA6kaMuS9dmWw3ClqS+YcIhA+f3BOxmNPFQY6HVyQ60vcM+DnLrz5s2o0Ob/+4Ec= X-Forefront-PRVS: 02524402D6 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(39450400003)(24454002)(229853002)(6486002)(86362001)(6506006)(4001350100001)(47776003)(66066001)(37156001)(5005980100005)(4326008)(98436002)(6116002)(3846002)(110136004)(38730400002)(53936002)(25786008)(6512007)(9686003)(54906002)(50986999)(54356999)(76176999)(2906002)(53416004)(42186005)(305945005)(189998001)(7736002)(6666003)(2950100002)(5660300001)(8676002)(81166006)(6916009)(83506001);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR0701MB1715;H:n7502mn2v03l32.qlogic.org;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR0701MB1715;23:Ep/yFjMwGZ2iwH7x9tObnVNu1n4aY+ebP7auWIw?= =?us-ascii?Q?vQMZB2aaKCBYrlICADtHnBnjqpvj0yOEYBLLkKS7NR31S2p/5lR47KwIoD5i?= =?us-ascii?Q?LJwjZgzlZ+Uzgk466KAOUlrYW3Hbwq+FUD2no59dCyrNXvvnvDkkqRd6KAlJ?= =?us-ascii?Q?pHrrmlOH2uDFFM50nLzr0lF1+iTPUOl06kb+ekGpESZPm2FZq8w3JJ0axXNr?= =?us-ascii?Q?MzpphvoPqTwgh5uw/ZBVIfG2P1Td4p/tP0qB3oVdXN4P31LeBtnexIvFWmlS?= =?us-ascii?Q?GIpyEBbPb+anjyiHdowqQiYG/JCjjbNm5+9TMbk+sJhIjRAhvnoAuRk1NOzC?= =?us-ascii?Q?Ei/nKL2ADXIR/XSxDO0Sq/agsMeVquoaZfxQxOua0Rgb2Aub6TNIVOhkeQ5E?= =?us-ascii?Q?3EP6rtoXO4S0OT15o7oO/xGJ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4IkEFSPHGY4DTJLDrox2i9WV+X6qDvRTedeL2csG8lqHcerkywyt+SiURf8gAqw4fe+51qZG/3sLAbFddDdNdFLUWHS3C1Ph1eUhHOIw==;5:9DhII3cDyauJpExniuB2ipiLwSFKGwqXdT9kRDMKVGRyynMYPXY78AhAsn5azYC1Ng+VuSAvHiVsPIJG6loUyud+S03rVL3ty1p85UZmvlTCUAp1NfJFjMnO0C+UVmy77hDShIvzDkhy1bRUK+43dQ==;24:U76XwSWEQ8z4NFz4nRCQ5asZm3Q71XTNAFcWZg+Jjex7pHGJMwCJaJuttyrc/ZX/xp5Unio/fPzcvAxVRfRL3QZr8WglGYznREtcl5C5Yi0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1715;7:Bd8e+UhdHut26S2qZmmZek7KFeg3KZh/7h9Y/otMlhvPd8c1Q0SrviEzpcYoXZMYMncfSRdYv2KMiMmgRC36S1qCkJGKFHcGbz9bNrYYMuA5LuRCS4bA0HITBitufHaFxpFnmY6JAQG1dHNs9KbxHuSi+RkjO48GEbAWduBeWTsRaUg+C1GF4TpP7Ykzve6p/rawPZnDXlAlp2XzvNmjR6mCe35bpkc25ltVBRKI1GtkuJZc5/ZqfolJV2FjhJKeMpqHsIDT0r57ZZrl3TR5VPaZNyUHYfsdZBQuW0u9hqPv9GxwcgOYMJazDSyczqPyWqZzbrkDL0A8tSgqxmLSMg== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2017 13:40:44.4358 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1715 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2264 Lines: 55 On Mon, 20 Mar 2017, 8:49am -0000, Arnd Bergmann wrote: > gcc points out that we are converting a 16-bit integer into a 32-bit > little-endian type and assigning that to 16-bit little-endian > will end up with a zero: > > drivers/scsi/qedf/drv_fcoe_fw_funcs.c: In function 'init_initiator_rw_fcoe_task': > include/uapi/linux/byteorder/big_endian.h:32:26: error: large integer implicitly truncated to unsigned type [-Werror=overflow] > t_st_ctx->read_write.rx_id = cpu_to_le32(FCOE_RX_ID); > > The correct solution appears to be to just use a 16-bit byte swap instead. > > Fixes: be086e7c53f1 ("qed*: Utilize Firmware 8.15.3.0") > Signed-off-by: Arnd Bergmann > --- > drivers/scsi/qedf/drv_fcoe_fw_funcs.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/scsi/qedf/drv_fcoe_fw_funcs.c b/drivers/scsi/qedf/drv_fcoe_fw_funcs.c > index bb812db48da6..8c65e3b034dc 100644 > --- a/drivers/scsi/qedf/drv_fcoe_fw_funcs.c > +++ b/drivers/scsi/qedf/drv_fcoe_fw_funcs.c > @@ -8,7 +8,7 @@ > #include "drv_fcoe_fw_funcs.h" > #include "drv_scsi_fw_funcs.h" > > -#define FCOE_RX_ID ((u32)0x0000FFFF) > +#define FCOE_RX_ID (0xFFFFu) > > static inline void init_common_sqe(struct fcoe_task_params *task_params, > enum fcoe_sqe_request_type request_type) > @@ -59,7 +59,7 @@ int init_initiator_rw_fcoe_task(struct fcoe_task_params *task_params, > t_st_ctx->read_only.task_type = task_params->task_type; > SET_FIELD(t_st_ctx->read_write.flags, > FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_EXP_FIRST_FRAME, 1); > - t_st_ctx->read_write.rx_id = cpu_to_le32(FCOE_RX_ID); > + t_st_ctx->read_write.rx_id = cpu_to_le16(FCOE_RX_ID); > > /* Ustorm ctx */ > u_ag_ctx = &ctx->ustorm_ag_context; > @@ -151,7 +151,7 @@ int init_initiator_midpath_unsolicited_fcoe_task( > t_st_ctx->read_only.task_type = task_params->task_type; > SET_FIELD(t_st_ctx->read_write.flags, > FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_EXP_FIRST_FRAME, 1); > - t_st_ctx->read_write.rx_id = cpu_to_le32(FCOE_RX_ID); > + t_st_ctx->read_write.rx_id = cpu_to_le16(FCOE_RX_ID); > > /* Init Ustorm */ > u_ag_ctx = &ctx->ustorm_ag_context; > Arnd, thanks for fixing this up. Acked-by: Chad Dupuis