Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753447AbdCTIuv (ORCPT ); Mon, 20 Mar 2017 04:50:51 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:57577 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753299AbdCTIus (ORCPT ); Mon, 20 Mar 2017 04:50:48 -0400 From: Arnd Bergmann To: QLogic-Storage-Upstream@cavium.com, "James E.J. Bottomley" , "Martin K. Petersen" Cc: Arnd Bergmann , "David S. Miller" , Ram Amrani , Chad Dupuis , Tomer Tayar , "Mintz, Yuval" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] qedf: fix wrong le16 conversion Date: Mon, 20 Mar 2017 09:49:27 +0100 Message-Id: <20170320084947.1031363-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:nIbhoEZL7KinZD14fiMxVyLt4/Cbz+69lgkC/DnfmDr+awvfb0I 5EIVoNbUaPI/vbARmC8b5PmGwZH64nfqYCjqsIJxBvssdx4sawZ9RHq7oJiSj3MI6bbXikr rlGN+sRZWDtzKRZuZJRHFEZdVeV2ehLPRjVxPEZXw0CtR7l7ACNL8Qy+FPd82fZC7EVttxI iqs0jF+UK0DHcs33U+UhQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:AmlY2KFpx3k=:FQIIPoTe2w6Frl5eu6CbQC 14bUxkhmxDFUmn5wT1PtuaV2vxyvK9rd4vLpzycqwa2hpVp4uT10SezGNaUwo+JcTyNL6sool INFmG6zdwWK+HgyorBfqCTC26mvOnryfoLDomEOPn92FeWbqNQKapKaxIRnWoVkVzodWQBHGl 7MG0y8elVEZfBBc6fB7t2Dl+8Fqk14DW0H4ZE/I3RWt84SuCedZXLp1+tKq9W8/761ZBPXws6 lDnmsmqWnRe5a2b1nJagfjViKHM1XxhP/0hbofDTtTltDJm2lhS4iT0BMxwWMigOzEq2RGODd bBsqzSRcGYZAUzZ4Wsoqe1ywL5c8HRtfIGzc8a6Z+6DBc6PfWkHcDo/60xfrGpn2AejynXI7l Y53fS6dCFSAsI6+vCzHbPFBAPKRuqX3wIn94T25aIA8w7uH9nyOO+Xbdvv6V8Vzko12PwEBJi SS6sX4RbvQCPux34t7lvbczXHpP04F25VDhw/6+ay5JO93+OtTUTtrR55QeBqKlwiFtmpUzfx DA7kwruu6nCVjMbyJcbTdKr2qrqFouwi2I1nGLlVNEHIlHCbp5lGC6Ygh/nVsUvCwVREwjw3B +5V+S3QpLFWJbJIKLenwDYW+YGslUzE1hgsukbDsySmit6eQX8Hilb1iX8xTZgpVj2dMynZUs /my2Gko5/mZNLQ/y2cggApFkTFC2cnyRvEmV3PNtNTLM+NMY+NQP6OHbordkpyE52rX8= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2037 Lines: 49 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; -- 2.9.0