From patchwork Fri Jun 30 16:10:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 106751 Delivered-To: patch@linaro.org Received: by 10.182.135.102 with SMTP id pr6csp6115616obb; Fri, 30 Jun 2017 09:11:43 -0700 (PDT) X-Received: by 10.84.232.130 with SMTP id i2mr25677605plk.251.1498839103833; Fri, 30 Jun 2017 09:11:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498839103; cv=none; d=google.com; s=arc-20160816; b=sBqdYy+XNo6Md7NfXob9oR1HuY8KKLcKSCqEVSksqznPqGfWQ6aCmKlqNm8C3hjPL+ JmmoKRAj3RHblk6O6xx1hTRL3OG6MzGgjbo3IlGOR1/psUP3uyOzUpcYnJYTDkxQJUh2 BZEe2GrLPwnKY/HRi/yU5RffA3gt9zwfh6RH7YNIlGyAhqmpC93mpJhSj6pv/KA5CRVi fsfLf+eTRarWdM9NJrrjzvxmgOsgF41BGbAfGEIplKUO1V52qz03iXgDC5g9Gkf+OZhq zSyz1fFWnKqePi5MOOGI/URTN5G9cpo7KGu+WiTfVJ6bgQpkKdqTbl8EzuBBr5qN8ytC vAjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=XsQgRlHnvSDK8uDmW0QzUQaM9L2PZnPC9K/iRnPpnb8=; b=soqjgfYsU9h24KaN/k+gCKEPjxrTy0f29UBUE3tcLEj+hEZJsgf8AfJQ8qZk76YuM+ CA5B78gSl1p+13aF0HnmUzgpQ77zwfmkUF/1MbZoYEG9y9drNdHnZr5411eAMPv10M1V WXjrOIOS9e8a/lc/Spu83no9eNbgkX3YqQlfyDenBSjOFZ1IAH2E497cLQEHvRdQZ+WR YfpINPlEc25n2ccUhT6s3LogdHujnHdK04ecghqqQMigCYOBduV65uSmXLWKOJXeEWNo 7Q59EAJpR7T1m9mxMvBkW5XWZ1rhjhm3lPpOWHUjJaSpMLqO11DmCIWhT6MQgBpeK+QQ RhkQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m61si6479134plb.149.2017.06.30.09.11.43; Fri, 30 Jun 2017 09:11:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751964AbdF3QLh (ORCPT + 1 other); Fri, 30 Jun 2017 12:11:37 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:60857 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751792AbdF3QLg (ORCPT ); Fri, 30 Jun 2017 12:11:36 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0MBCPl-1dYv8W3Nen-00ADSg; Fri, 30 Jun 2017 18:10:57 +0200 From: Arnd Bergmann To: qla2xxx-upstream@qlogic.com, "James E.J. Bottomley" , "Martin K. Petersen" Cc: Arnd Bergmann , Himanshu Madhani , Darren Trapp , Giridhar Malavali , Duane Grigsby , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] scsi: qla2xxx: remove incorrect byte swap Date: Fri, 30 Jun 2017 18:10:39 +0200 Message-Id: <20170630161056.30630-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:g2vZe23fpL+U9yOpcpWnmEYFxBLn1vw3CrI8KzeQ1zLGFssRWj0 axx6hMlvF+S643k4MMAre5NhheaLl6cj96DJz0kzT9RAWHp61CqVtRn+Ux8wAnekWb8pAys NKlpbUUelFsWRa1pbi0cGetq4HjHTNqeTeqo1mDroYVIFSM5bwmraDfRb896BUSS96Mv7aC MITt40Lb0QYgNBrIwxo/A== X-UI-Out-Filterresults: notjunk:1; V01:K0:8gQEsztppTo=:r+i7IYti9PFBtlPF1H+sCa ob9wvT9i6PaS5x+pGqF0ncWDyxLwqFYhf3sxnYZQl6G2egHON29cpRGwRe9ncbmptQ4AlrRrC C1bpJ/UYks7+YZ1Edy4wVRAOvFQIUdfrAAAJYK9Ja1l0aie8dyLLhe7EvGANEH2Db5kOl2X5w 5caw+vx1jv4trFVDnIdzIxb8PFZPoY8wDgqttePHhnS2W3iGtgpGkDUw8n/kvcEIcMk1TPSj4 ZihMgFyAtZs9t1tISPLSEJSAqbWZT7JhlmSJI4OGxqPWPgdY7l4ulB5/vwJXYJfiNMDniXYje k1b8low16F6E2tdHb2TQi1D0haOa0AA1MIZWehh3VSYvK06Cnj07e70KLWN4eWCNutDSmarzg /ovpdw1Be1lvo6UUmfrw3Q88bs82vwklKX1DHYckhMePnDqGiQF3Z8whYVf4rwk4u5dS+OmaU UiIonSdPXF1sS6O12Qyg1Py3ZlfIsCzjJPnYwvSW+/Ze+OPgvUfwb1mI5MljUdq/YnY1nXhd3 HIRXjj8fvPd1dFwvi8tP2Au3t4+0KXPov+UiVZKzk2NIOEuf70o8fKMhw8TmyMHkVXAzTl1pf Nij9QoDkgZqOzY7zN8qDajNJ6ekkDt872wgpAx6VtUtkyPvxS7G/ILEsPcGcY4J4/d3VX6Jwr +XNnXxhnAe6m1FPWo5QcPi3GLf8hSaHMGzanp/NZqUJcS+PoepRpQFBylH6DFoqVE5Iw= Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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(-) -- 2.9.0 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; From patchwork Fri Jun 30 16:10:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 106752 Delivered-To: patch@linaro.org Received: by 10.182.135.102 with SMTP id pr6csp6116288obb; Fri, 30 Jun 2017 09:12:20 -0700 (PDT) X-Received: by 10.98.15.220 with SMTP id 89mr23435877pfp.203.1498839140046; Fri, 30 Jun 2017 09:12:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498839140; cv=none; d=google.com; s=arc-20160816; b=iHTx4dJHQQbN6e+7ikTfRLRNrSf1dYtt704kmQw+dpXUtKty0ZbxPhc5vYHO6BSlnQ /vt7/ETFq75MaMpZUddJM27MtfmJmQKR2Oldcm43nnnUpELo2VoAn2or805KfjNtbDFx COQKOLnW4zmymp/Lw31N7uSeAwhTJXMlhza858ha2leYCjINuAaJZ1oHfFVBqYVUZ06j aaecoFYWk5AVfPXzLPlagmqlOCbJdi6eRZRXR1vI0zB3SPMMpSNURAeO4A0aWuQWHGBV lDfQNkIL4sXaBksCVAUXlessd84FKGD8XUsyNeofaBaxVkbSvuDvnka7HVhtf1tJvx3r kbuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=qVrchzBLz6J9B07ONlKqxrBawACaPvSLg0VmGY+DDxA=; b=Nok0QbGvQCZG6+eo6PzX+4wsReNg8Mwvn2G+BxfyIlXMkhNFpU78CbQ/SkNq0QKLpT Mq4t9BmvKUEhRj+u2lUaippXyqfJkJd8WSZ6KObcHumXkuyFkgg/L3FqYQC0dJWDxiAL 0ZcGmGtgelfQNP7RScJH+WeCD4/3ZqiJDhbo8pYRFA8GKR5UvLAdk/aXVgB43ppV1fCm BbfLN3ceni2izspozOA5Hi8j/gK/AF0Y/NSZyuwYqhJM3Knur/sYAPp/iecRXqbeYnEp 2eXdi3UI9gudV8drEbWgwGXUqB8YIXqI0RTl0qJ2q4sRaDVpMXMHOxDGZWky45fekAEB paSw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 72si6801212plc.44.2017.06.30.09.12.19; Fri, 30 Jun 2017 09:12:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751874AbdF3QL7 (ORCPT + 1 other); Fri, 30 Jun 2017 12:11:59 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:51485 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751946AbdF3QL6 (ORCPT ); Fri, 30 Jun 2017 12:11:58 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0M0Qqz-1dk1073d1B-00uapK; Fri, 30 Jun 2017 18:11:19 +0200 From: Arnd Bergmann To: qla2xxx-upstream@qlogic.com, "James E.J. Bottomley" , "Martin K. Petersen" Cc: Arnd Bergmann , Quinn Tran , Himanshu Madhani , Nicholas Bellinger , Darren Trapp , Anil Gurumurthy , Duane Grigsby , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] scsi: qla2xxx: avoid unused-function warning Date: Fri, 30 Jun 2017 18:10:40 +0200 Message-Id: <20170630161056.30630-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170630161056.30630-1-arnd@arndb.de> References: <20170630161056.30630-1-arnd@arndb.de> X-Provags-ID: V03:K0:YTg6gL97IyqG1/4V+UXYFY0OA8VkY9+yO9+UFq9cpROzgv6VWxI 70p7/0YuvdTaBC0AxDO22ndcvE7WSXzmzTSjFMnzzPTJovCL4SJyuAMI3/yT5c16n3YZ5sr BhuED4/zZFn+BGdQTHakLONAX8LulHT6S1A8JgkJJ7TVb/7PzWu4djLXqgvaRDqEwVuSeLW +JqIM0amYDAY9xdzpQWyw== X-UI-Out-Filterresults: notjunk:1; V01:K0:pnV8LIp9wJs=:3bK3bK2OQOTOBoTp1NsPCk j1t9WL4m6GcTFgbKJqVPdkKDbAN39pGjrZ/bSNHq2O8VA4uF9x17uSzrgpH5aPSEXYQAuhs+H MkQbSviTovcDZUbYiqXnwMDl5rHneLmkZAPDl4KNZd/MQ811Bfqcpt06hHCZ5yAKfr8upqVad UVjHcZOyHHvVqTCKDbaM86MrLI4w5QSBDuFVLgsZhHlMuYFCzrznqLFArbUvSp50Z0Q+XJFYa +IQhMyonebJndoR8Na7slFgbt6/CWKChpoTkc6H/DhH7w+4pU0z2MiWoVtSxzLkZDGH8/DnOj IDkLL+49VugYKtKhtbNcz/HMmlW7bAGmNnZcW+T9VyO0DIplQl+ExYTUq2WFBwxKlILFcixLY 9w6wF1EotsvHWF3lclraiHRHVgUJNLWrUBTwv9+gxozZWJm8SBdXlEpKvSUnwZJB9/Uz/6g+I BZThY83aY8d5+qV9ZF0Xq+kst4WwKp1iZZsd6DPaRgcHpsHHmoEBWYX/gsxyAfe7ImtE1vN2H RDHTtO4JxyFHWtjk1A8buIuStAzqJbqWtSeM57X5PE+Q02oVVgHlAkp6Oiql3YSQOuTONZFY3 l8WFEeIN6zDu0lU+TjToGMgMzHe96MxSw9ZgGHyHJz4sco9kzndASvnJYij0skPwYnH7Kv8zl 8SwVTWQhN5paM/c4UvFT4w3I4Vy2osdx1Q5PBA7Jq3juZYUra46fQqZwp9FImzBnhBT8= Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org When NVMe support is disabled, we get a couple of harmless warnings: drivers/scsi/qla2xxx/qla_nvme.c:667:13: error: 'qla_nvme_unregister_remote_port' defined but not used [-Werror=unused-function] drivers/scsi/qla2xxx/qla_nvme.c:634:13: error: 'qla_nvme_abort_all' defined but not used [-Werror=unused-function] drivers/scsi/qla2xxx/qla_nvme.c:604:12: error: 'qla_nvme_wait_on_rport_del' defined but not used [-Werror=unused-function] This replaces the preprocessor checks in the code with equivalent compiler conditionals, which lets gcc drop the unused functions without warning, and is nicer to read. Fixes: e84067d74301 ("scsi: qla2xxx: Add FC-NVMe F/W initialization and transport registration") Signed-off-by: Arnd Bergmann --- drivers/scsi/qla2xxx/Kconfig | 1 + drivers/scsi/qla2xxx/qla_nvme.c | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) -- 2.9.0 diff --git a/drivers/scsi/qla2xxx/Kconfig b/drivers/scsi/qla2xxx/Kconfig index de952935b5d2..036cc3f217b1 100644 --- a/drivers/scsi/qla2xxx/Kconfig +++ b/drivers/scsi/qla2xxx/Kconfig @@ -2,6 +2,7 @@ config SCSI_QLA_FC tristate "QLogic QLA2XXX Fibre Channel Support" depends on PCI && SCSI depends on SCSI_FC_ATTRS + depends on NVME_FC || !NVME_FC select FW_LOADER select BTREE ---help--- diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c index 14e25e32e622..9c18d754ac33 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -17,10 +17,12 @@ static void qla_nvme_unregister_remote_port(struct work_struct *); int qla_nvme_register_remote(scsi_qla_host_t *vha, fc_port_t *fcport) { -#if (IS_ENABLED(CONFIG_NVME_FC)) struct nvme_rport *rport; int ret; + if (!IS_ENABLED(CONFIG_NVME_FC)) + return 0; + if (fcport->nvme_flag & NVME_FLAG_REGISTERED) return 0; @@ -78,7 +80,6 @@ int qla_nvme_register_remote(scsi_qla_host_t *vha, fc_port_t *fcport) init_waitqueue_head(&fcport->nvme_waitQ); rport->fcport = fcport; list_add_tail(&rport->list, &vha->nvme_rport_list); -#endif return 0; } @@ -666,11 +667,13 @@ static void qla_nvme_abort_all(fc_port_t *fcport) static void qla_nvme_unregister_remote_port(struct work_struct *work) { -#if (IS_ENABLED(CONFIG_NVME_FC)) struct fc_port *fcport = container_of(work, struct fc_port, nvme_del_work); struct nvme_rport *rport, *trport; + if (!IS_ENABLED(CONFIG_NVME_FC)) + return; + list_for_each_entry_safe(rport, trport, &fcport->vha->nvme_rport_list, list) { if (rport->fcport == fcport) { @@ -680,16 +683,17 @@ static void qla_nvme_unregister_remote_port(struct work_struct *work) fcport->nvme_remote_port); } } -#endif } void qla_nvme_delete(scsi_qla_host_t *vha) { -#if (IS_ENABLED(CONFIG_NVME_FC)) struct nvme_rport *rport, *trport; fc_port_t *fcport; int nv_ret; + if (!IS_ENABLED(CONFIG_NVME_FC)) + return; + list_for_each_entry_safe(rport, trport, &vha->nvme_rport_list, list) { fcport = rport->fcport; @@ -711,17 +715,18 @@ void qla_nvme_delete(scsi_qla_host_t *vha) ql_log(ql_log_info, vha, 0x2115, "Unregister of localport failed\n"); } -#endif } void qla_nvme_register_hba(scsi_qla_host_t *vha) { -#if (IS_ENABLED(CONFIG_NVME_FC)) struct nvme_fc_port_template *tmpl; struct qla_hw_data *ha; struct nvme_fc_port_info pinfo; int ret; + if (!IS_ENABLED(CONFIG_NVME_FC)) + return; + ha = vha->hw; tmpl = &qla_nvme_fc_transport; @@ -752,5 +757,4 @@ void qla_nvme_register_hba(scsi_qla_host_t *vha) atomic_set(&vha->nvme_ref_count, 1); vha->nvme_local_port->private = vha; init_waitqueue_head(&vha->nvme_waitQ); -#endif }