From patchwork Wed Jan 27 15:57:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101066 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2663652lbb; Wed, 27 Jan 2016 07:58:47 -0800 (PST) X-Received: by 10.66.234.200 with SMTP id ug8mr43924602pac.129.1453910327008; Wed, 27 Jan 2016 07:58:47 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qc8si10254213pac.39.2016.01.27.07.58.46; Wed, 27 Jan 2016 07:58:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934001AbcA0P6o (ORCPT + 30 others); Wed, 27 Jan 2016 10:58:44 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:57171 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933603AbcA0P6b (ORCPT ); Wed, 27 Jan 2016 10:58:31 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0MFcG5-1aLQ5U27sL-00EdqW; Wed, 27 Jan 2016 16:57:53 +0100 From: Arnd Bergmann To: "Martin K. Petersen" , James.Bottomley@HansenPartnership.com Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , linux-scsi@vger.kernel.org, "James E.J. Bottomley" , Rik Faith , linux-kernel@vger.kernel.org Subject: [PATCH 1/7] scsi: fdomain: drop fdomain_pci_tbl when built-in Date: Wed, 27 Jan 2016 16:57:17 +0100 Message-Id: <1453910247-3447628-2-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1453910247-3447628-1-git-send-email-arnd@arndb.de> References: <1453910247-3447628-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:BNNrh3tWSgrqPGiWaBhENYfLn50HUmSb2AmRGdmlBKhOBNdlWhL 1tbaKHAGAN+3yMFHIT1x2kpAGXpusCuN/kFHNZXJCtHRUxox7Oj41Tlga5JlA79kVC75eVo +WxAlf7oDxHFBla5ESS7LBe/HdO69+yws75MpQz/Dd4cOLnhovQeqc2fJIFCIiafNPGMQHs aPMB2QjVKiMLgjsSM+f0w== X-UI-Out-Filterresults: notjunk:1; V01:K0:XkHnGXjgJ10=:JR5hyMUwaut/yUrBOT2dKv Ul0KEj0h8GMEQ2DPuIz89MNx4t0H56ej0vrrnjIiA7TW7IFAUbXZcmVzAgVWyPnzKVHXidJPp KYDXO5oVj6gHueU+KVMUQBDeoXrtsRy9AzlpGhqxDBbKND5JO83GH940PY5J18wQJFSsuvWpZ rFku8rMAoaCihnAo5Qyi5QCWvSc/1aSK6lk8vJcz3L4lkm/rTsdDcyyopYEJMcP+n2BQAMGm/ w7WQopLsRiyF+H2j9UQ+ejrpc2pmvU5qPaiyvPWDPU4i/U/+He9k7YE5p0NFWbI8Nj25gYox/ e7CAcH4ZmNOtahPJTVoMunOD32BSjDyvnclXPli207QIirc6CEgXUKNltzLy7MGZHetjOn2Mu 87RAWKIVELV9kF5BtU/3pHQ3B9KN3mG4iK3LEBJbxKPt536ks9WMYWVYBtC1W28qmb3AHZ/wd cilw+9cRnkmgV38ks64Wcn89oUSqBF5Rrp5MhYpMbw4GqI0yu1sVqzUVPw35EiYIAJXG8YN6X x3qdq7QW0wAT1buuBBSakbSX9Ml0S0QjNlxqDvEb8/gi0ZNBJzKUqPDfF9yiPUxq3zXeeoB6e 3+QAJh9J/XFCSTVeIb85u9Dt+TlmNLSlkCOqj7/3yPwkJmItPCBEtBD1sSDkqBtzRxFSLqSiJ U9YhBvyOqC6xqx1whpDWh8hDuSlkjKw7AStN4kIS1XQaH8IjltxwsWBXzd3ywkUc/OUo= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The fdomain SCSI host driver is one of the last remaining drivers that manually search the PCI bus using pci_get_device rather than registering a pci_driver instance. This means the module device table is unused when the driver is built-in, and we get a warning about it: drivers/scsi/fdomain.c:1773:29: warning: 'fdomain_pci_tbl' defined but not used [-Wunused-variable] To avoid the warning, this adds another #ifdef around the table definition. Signed-off-by: Arnd Bergmann --- drivers/scsi/fdomain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.0 diff --git a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c index eefe14d453db..b87ab38a4530 100644 --- a/drivers/scsi/fdomain.c +++ b/drivers/scsi/fdomain.c @@ -1768,7 +1768,7 @@ struct scsi_host_template fdomain_driver_template = { }; #ifndef PCMCIA -#ifdef CONFIG_PCI +#if defined(CONFIG_PCI) && defined(MODULE) static struct pci_device_id fdomain_pci_tbl[] = { { PCI_VENDOR_ID_FD, PCI_DEVICE_ID_FD_36C70, From patchwork Wed Jan 27 15:57:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101064 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2663977lbb; Wed, 27 Jan 2016 07:59:29 -0800 (PST) X-Received: by 10.98.44.66 with SMTP id s63mr43808690pfs.2.1453910368908; Wed, 27 Jan 2016 07:59:28 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id vw1si10249562pab.74.2016.01.27.07.59.28; Wed, 27 Jan 2016 07:59:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754793AbcA0P70 (ORCPT + 30 others); Wed, 27 Jan 2016 10:59:26 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:58313 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754761AbcA0P7X (ORCPT ); Wed, 27 Jan 2016 10:59:23 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0LrsPm-1ZxGgv1Y5u-013gq7; Wed, 27 Jan 2016 16:58:43 +0100 From: Arnd Bergmann To: "Martin K. Petersen" , James.Bottomley@HansenPartnership.com Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , linux-scsi@vger.kernel.org, "James E.J. Bottomley" , Russell King , linux-kernel@vger.kernel.org Subject: [PATCH 3/7] scsi: acornscsi: mark calc_sync_xfer as __maybe_unused Date: Wed, 27 Jan 2016 16:57:19 +0100 Message-Id: <1453910247-3447628-4-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1453910247-3447628-1-git-send-email-arnd@arndb.de> References: <1453910247-3447628-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:PaXOkvslz/EPwVqBbl9Bw4Bythq/Qp2QsDuvCUejtlJXJQSRfp0 Rao6ohvJHDHg5Rp7g5hdiIcp9anSnSQbJ+icnXPi/4oX5TYAuWAVn/0m6+5k2WSavzcKIZw MGNhVhpgwhCIUZo05xAdJsGz9zWOYxFysWUNrDm8G4UWy9v7OkEO6XCxc6uen7ZefizBUoo Z9CjwWiAIEGfoMMN0FwgA== X-UI-Out-Filterresults: notjunk:1; V01:K0:FEYiRIa7unI=:Iidx6PxtbWS/rDCVNlV0B/ 81rvJUE0hXSnxOWQtfhXwJZa1L+PFh7r8q3GrQgHLp3R9e8/GC0oMDnypdQrifz9L9kHvVXhC pDGmwPqYYthxuXWUfJMt5plTWRbBpn4yL3uLEC3wJEqCbP6Mb/fYDvxMXnzsiKW5ruOj97NGT GTQb/Uw0YGAkS+A55KiGfEXeQQVjaQPgXL8ksmShlATCsM+ohqj4XiJu+eYqhvPrfT4sIDNAO hgopkPHMVGny9O4RaR+RcY6H6u/6ZuO5Ijt+sknslEm18P7ZwWVcF7O5g2sMevTopKB2w50oY DpXhftvDdA0dFtZkQcRIku/0uCzsaTnGaVZf2pyqzYK4Q0GEeNaipnOF9aP0AGCNCWHyzsZXG aE22mHNpjLg0PNQemhYV1FD9Zw6njM1KjaexhPcqser2u8wZbkeVzOaSxKpUrzy384B9K6GWg il/8aXA7FkNX+J9qLiwt+SMPGOC7Gd8HUbaqMKiEIXcncZ73ICSJN4Giba4XA9rm3EV+DN/5A wLWvzXYUdFOR/rrZY6p6phQR6awELryMXtYeOaY25z5BPQuRYCGEy6VKhwc2eRS2f/W/cyOg7 Z5iYaJqcRS3Vc3qtW/pbzvT5u2+i5JijBlii/RszwZfRddA70xCpfplUrZdfLkTuTjYkDqj+e i43OxRkW/FTxE8gZ38642qY6wu5ubPwjT7gfVL32IDHLZV0d2rz3PqKl89YTvxlSq7ag= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The calc_sync_xfer function is only used if CONFIG_SCSI_ACORNSCSI_SYNC is set, otherwise we get a compiler warning: scsi/arm/acornscsi.c:680:15: warning: 'calc_sync_xfer' defined but not used [-Wunused-function] unsigned char calc_sync_xfer(unsigned int period, unsigned int offset) This marks the function as __maybe_unused to shut up the warning and silently drop the function in the object code when there is no caller. Signed-off-by: Arnd Bergmann --- drivers/scsi/arm/acornscsi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.7.0 diff --git a/drivers/scsi/arm/acornscsi.c b/drivers/scsi/arm/acornscsi.c index deaaf84989cd..12b88294d667 100644 --- a/drivers/scsi/arm/acornscsi.c +++ b/drivers/scsi/arm/acornscsi.c @@ -677,7 +677,8 @@ int round_period(unsigned int period) * Copyright: Copyright (c) 1996 John Shifflett, GeoLog Consulting */ static -unsigned char calc_sync_xfer(unsigned int period, unsigned int offset) +unsigned char __maybe_unused calc_sync_xfer(unsigned int period, + unsigned int offset) { return sync_xfer_table[round_period(period)].reg_value | ((offset < SDTR_SIZE) ? offset : SDTR_SIZE); From patchwork Wed Jan 27 15:57:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101063 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2664063lbb; Wed, 27 Jan 2016 07:59:39 -0800 (PST) X-Received: by 10.98.75.139 with SMTP id d11mr43272746pfj.57.1453910377978; Wed, 27 Jan 2016 07:59:37 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id vb6si10213496pac.158.2016.01.27.07.59.37; Wed, 27 Jan 2016 07:59:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754813AbcA0P73 (ORCPT + 30 others); Wed, 27 Jan 2016 10:59:29 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:64187 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753248AbcA0P7W (ORCPT ); Wed, 27 Jan 2016 10:59:22 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0M3Sim-1a6ecv1JEO-00r0qX; Wed, 27 Jan 2016 16:58:53 +0100 From: Arnd Bergmann To: "Martin K. Petersen" , James.Bottomley@HansenPartnership.com Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , linux-scsi@vger.kernel.org, "James E.J. Bottomley" , Russell King , linux-kernel@vger.kernel.org Subject: [PATCH 4/7] scsi: fas216: avoid fas216_log_setup for loadable module Date: Wed, 27 Jan 2016 16:57:20 +0100 Message-Id: <1453910247-3447628-5-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1453910247-3447628-1-git-send-email-arnd@arndb.de> References: <1453910247-3447628-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:u2IaGMNIv1cysA8lR08duHaa0zAi8lfZ2oX4yU8KdGJBtrSd+c0 hNe5IX9RwO3VbVIBPW0/Lhay62Z+SuxKcXBs7wXVjcaciC6nvWEGpNp6zzTE4+6Cy8UP0kQ giTqQWeUmR/bENFGGPMw+2LOSFK6q6bIFHrwE2EDPKG2EfaS8F+3mRxlSeYEYGxnck/LHIJ Ct19idyZVYuC2EbOGbYTA== X-UI-Out-Filterresults: notjunk:1; V01:K0:mKw5/SVMhFI=:hNIghXMwk8jFcbL0Tz484O QpRRFzAre5t3bGMRC+kgcaUfd1Ivs7zV2n+2vZfExHATHwD4jypQLD+HPeWd8h3jytI9WiUSI s6hE5lMMbHN1Z180Lj7B7vHluRiW4laCzkDlFbDFcCsJJNumz0jW+DdHjswk8CvWcQb21D4lt N3a1tLUq0UEpCW1rx3qP/mfYwNokcVJryPN+D3NQxx3AEQjclGmdu1QBGtE/hG/WZ6hxTyhbB JM6UvFVqUa4QowcDBaPYIfcsetFB3yzAwA6mbPJUjCLgze1tTcX3rOPbQraFpgS8F0PR+OnNz jIE1vt97PFOAY8bvuWrzfDFGfwelz3whQUsIwUgBsAmyz+CcU6BfKwlRUZcL6UdHZxKVKi5Ch k/bl1GneW+mCDZdgyavRlSWf69HKEPQK5cfU0Dr9X9qzYK8wL4DtIxpJwjzDAm8jIZ6LBsCXr K5OYGhcKFPIQxeXKVOxV/9Q2b9TungX0pkU4RGPILJ8PBYBUHCueI+edd59/qycsZwU7NpcCt fdOlURRnB5D9h+dzHOvm0EgZE3C81dEgneb4Bp/HkkbcVe/IxO8544lC+/AivA/Fd+8L3BnEL Ma1zo2qntfaCfMT/PrPDveW0zadqD5gLAhsJZPkdANRCLf1Oua9Vc+s8SlP5xd1teO8+UPCPc otgfacgYgu0yi8Uc1xeGivs7fFczl1wYydZ26G/6OCp47RV9xUcKOukOXFxvTlpi1r8A= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We get a warning for the fas216 driver when it is compiled as a loadable module, as the __setup() functions are never called then: scsi/arm/fas216.c:101:19: warning: 'fas216_log_setup' defined but not used [-Wunused-function] static int __init fas216_log_setup(char *str) This adds an #ifndef MODULE around the definition to shut up the warning and clarify for the reader when it is used or not. Signed-off-by: Arnd Bergmann --- drivers/scsi/arm/fas216.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.7.0 diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c index decdc71b6b86..24388795ee9a 100644 --- a/drivers/scsi/arm/fas216.c +++ b/drivers/scsi/arm/fas216.c @@ -98,6 +98,7 @@ static int level_mask = LOG_ERROR; module_param(level_mask, int, 0644); +#ifndef MODULE static int __init fas216_log_setup(char *str) { char *s; @@ -138,6 +139,7 @@ static int __init fas216_log_setup(char *str) } __setup("fas216_logging=", fas216_log_setup); +#endif static inline unsigned char fas216_readb(FAS216_Info *info, unsigned int reg) { From patchwork Wed Jan 27 15:57:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101062 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2664105lbb; Wed, 27 Jan 2016 07:59:45 -0800 (PST) X-Received: by 10.98.64.215 with SMTP id f84mr43456740pfd.113.1453910383291; Wed, 27 Jan 2016 07:59:43 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wg9si10183973pab.242.2016.01.27.07.59.42; Wed, 27 Jan 2016 07:59:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754833AbcA0P7l (ORCPT + 30 others); Wed, 27 Jan 2016 10:59:41 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:58525 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753248AbcA0P7c (ORCPT ); Wed, 27 Jan 2016 10:59:32 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0M7Kru-1aCj8l0TUU-00x57P; Wed, 27 Jan 2016 16:59:01 +0100 From: Arnd Bergmann To: "Martin K. Petersen" , James.Bottomley@HansenPartnership.com Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , linux-scsi@vger.kernel.org, "James E.J. Bottomley" , QLogic-Storage-Upstream@qlogic.com, linux-kernel@vger.kernel.org Subject: [PATCH 5/7] scsi: qla4xxx: shut up warning for rd_reg_indirect Date: Wed, 27 Jan 2016 16:57:21 +0100 Message-Id: <1453910247-3447628-6-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1453910247-3447628-1-git-send-email-arnd@arndb.de> References: <1453910247-3447628-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:7jqmaIxu1U87yzN2HeYz+y8f0DhDCQObvh5CO6v1LkArUxAnsLw LjDYHeHHcjQ1p8T67HP6PpHqRXM6ivfwxxH9agI75lARq3RmHuoW6RpE6EmQQ+FI/thH/JI g85ZmqfPWO80kl+pvZVr+Ed3DlDIWd8VRFUsvshizK6HNM1WxiT8sOgxIfQr4CJLiv+j6iT J7vrPnJ0EA5FH3J5664FA== X-UI-Out-Filterresults: notjunk:1; V01:K0:g/vw7tjbVZA=:zF7CzlAseq9uSYfSAYWC62 9bOaVf4SEQaBW3BVhYq/GbvwWlKo8/+AU9U3B70emp2vWr4iSUtlFdbc4hWCx80NM115Ilz4v CgIyOCeqcdSzzXF1oAZQC3xoyCMxzsc3WQy/ZYyN1Af4Y9OEuowuhyp7UuHZPidAN/23CEPMJ hYx+PFRTYsQidYH7/+29ts3agTpK8hzxG1M6BazFD94pj/jnRYF+7qYRITDw9ByaFBmTv/uMy KRJ7RnJgtrf6PIO04v7s/Zu8LvlsxqWRZNJLxweNUVhgE1ki/HelIUlz94pbJbTXTWAccrQEH Qzk90SloyWWG5cZ4Vw8v4CBQQHM0d5yvZCdG3k1+pSXa9vQtmF/f6KlSCqCBav8/VHdNhnNZq H3mqJApFVJXtDs7zOVfKiC7xbKuTOjP3JM0ZzWPozRZaaG0sWvzXSM4wEVBtnlvPUvMGIaE6I DSPtS0Pbou+WtrtBUzWj0GCK/wdBj788AJmbTBuyXL/s8L0yH2F91oQ3O54f1RIpxHjsUxdHv xYg46VYis4XNoXUH2MAJw42+hTugHdzG9VBIXQ37p2jPPPGJUbWGI/CgBYWHoaSuvjX5GDdHz JXEJv2BwSn8IX6DunssQ7tJNyDn1zxw7xqwTPr7IwwB9J0UMRzKm8WuA/PcGphLXPcvwhvipW MXPE1h0w1niYXoc7mlO0VRLgn5O/PIuP4VYhNNSYCXdiOCClEkt/ucFN4sL+rYbONkM0= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The qla4_83xx_rd_reg_indirect() function can fail when it is unable to read a register, but not all callers check its return value before using the register data, and gcc correctly warns about this: qla4xxx/ql4_83xx.c: In function 'qla4_83xx_process_reset_template': qla4xxx/ql4_83xx.c:1073:36: warning: 'value' may be used uninitialized in this function ha->reset_tmplt.array[index++] = value; ^ qla4xxx/ql4_83xx.c:1050:11: note: 'value' was declared here uint32_t value; ^ qla4xxx/ql4_83xx.c:902:8: warning: 'value' may be used uninitialized in this function value &= p_rmw_hdr->test_mask; ^ qla4xxx/ql4_83xx.c:895:11: note: 'value' was declared here uint32_t value; ^ In file included from ../include/linux/io.h:25:0, from ../include/linux/pci.h:31, from ../drivers/scsi/qla4xxx/ql4_def.h:16, from ../drivers/scsi/qla4xxx/ql4_83xx.c:10: asm/io.h:101:2: warning: 'value' may be used uninitialized in this function asm volatile("str %1, %0" ^ qla4xxx/ql4_83xx.c:874:11: note: 'value' was declared here uint32_t value; ^ Unfortunately, I don't see any helpful way to add proper error handling for this case, and the failure scenario for rd_reg seems rather obscure, so this bails out and makes the rd_reg accessor set the result to 0xffffffff so we at least get a predictable value. Signed-off-by: Arnd Bergmann --- drivers/scsi/qla4xxx/ql4_83xx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.7.0 Acked-by: Nilesh Javali diff --git a/drivers/scsi/qla4xxx/ql4_83xx.c b/drivers/scsi/qla4xxx/ql4_83xx.c index 5d4f8e67fb25..638f72c5ab05 100644 --- a/drivers/scsi/qla4xxx/ql4_83xx.c +++ b/drivers/scsi/qla4xxx/ql4_83xx.c @@ -46,11 +46,13 @@ int qla4_83xx_rd_reg_indirect(struct scsi_qla_host *ha, uint32_t addr, ret_val = qla4_83xx_set_win_base(ha, addr); - if (ret_val == QLA_SUCCESS) + if (ret_val == QLA_SUCCESS) { *data = qla4_83xx_rd_reg(ha, QLA83XX_WILDCARD); - else + } else { + *data = 0xffffffff; ql4_printk(KERN_ERR, ha, "%s: failed read of addr 0x%x!\n", __func__, addr); + } return ret_val; } From patchwork Wed Jan 27 15:57:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101061 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2664146lbb; Wed, 27 Jan 2016 07:59:49 -0800 (PST) X-Received: by 10.98.75.156 with SMTP id d28mr44056455pfj.108.1453910389800; Wed, 27 Jan 2016 07:59:49 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rm10si10276760pab.25.2016.01.27.07.59.49; Wed, 27 Jan 2016 07:59:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754858AbcA0P7q (ORCPT + 30 others); Wed, 27 Jan 2016 10:59:46 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:65525 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753248AbcA0P7m (ORCPT ); Wed, 27 Jan 2016 10:59:42 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0LymAB-1a4ARB2PqB-016BwE; Wed, 27 Jan 2016 16:59:06 +0100 From: Arnd Bergmann To: "Martin K. Petersen" , James.Bottomley@HansenPartnership.com Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , linux-scsi@vger.kernel.org, "James E.J. Bottomley" , linux-kernel@vger.kernel.org Subject: [PATCH 6/7] scsi: aha1542: avoid uninitialized variable warnings Date: Wed, 27 Jan 2016 16:57:22 +0100 Message-Id: <1453910247-3447628-7-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1453910247-3447628-1-git-send-email-arnd@arndb.de> References: <1453910247-3447628-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:WqFAMkCis1TjQHB7rawQrJYobx9/XSRFP2bYxc4Ev/uh58g4Xk2 YXOppWJ9G3/bI9oEW2WnJtb7HAv3E3OsF586DLJDwSZfZbkGVxGR+4t/8l0CzuVtYFOZDGQ vH3o05kL2JMRLrKtQoL+E8Cro9uf8dkxSksw1ANR/tmgvC7VDRKbWysCxhjrmH7vEmGsVEL CqMI4dlKiCNBtPxPQp/xQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:5Ec4e406wUY=:6/qOgvD1oSUREOlg61Ch3s kr/MLYDZ1qFMf46EbbZ7SbWtR0A7wCnzxiVk7jBuNOQdW22Tn0k6PthDvhSJjyIBRqqBORGKy am2bfvThMju0wyO3U+oqXgQgMxBAouRMScwRVGYsUiz3IUtFM7Vk7NjEFZljpEN/oq/63pC+Z xUnjST0pc1xMBAZgxCgOK+FMIVoIelInFdX3+4puWUJL3p9BB5JNHnKrD+wn6WANOwVWcg06a h97vkPJR5THBs40CYmED+/cLTECEJFq0FC1u/d5l39xh9S/38bnEEgyyR9XGpmf5JrO0DGa02 2k0HxPAGZVyUKnL0ekZk03k7rj2+LLzMdUPkdooJKWgAPYOZv7QjyrckVDJfeROvdL9GkFolX FVrjsVHAqlo33kz5/pJNWtA0OLFCIgjZNliteGCBYRmXDx99Yi05aQENIttjGigtsDk+FPJnh iZsybVmE/oDHSw24CKr3x69e0KvyQGYYffhEvjzdDljYq+N6Dwb8wxyZOWFuxfBnWrHI2i2HF VdbUOKHf767GtI4IAGhnt9+/4OaIYli9Hx7n5wkciNdoQhKFvSKNi0lkl3Dxz3uUMwEpQgzas pYWOFtFKImQaL+oof8O1tUUQgE0X26YFt2tHWv77xG7Ju7XirLnnEOLumcvaRz1i0YVB9QKhJ cu3ssm/5HBIwf/S3PHCg2VkB5EQoOxpXcwgCdlo1gna2lQCdNMEXXaC4MDAyMfXgFkWQ= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Gcc incorrectly detects that two variables in aha1542_queuecommand might be used without an initialization: scsi/aha1542.c: In function 'aha1542_queuecommand': scsi/aha1542.c:382:16: error: 'cptr' may be used uninitialized in this function [-Werror=maybe-uninitialized] scsi/aha1542.c:379:11: error: 'sg_count' may be used uninitialized in this function [-Werror=maybe-uninitialized] The only user of these is doing the same check that the assigment has, so it is actually guaranteed to work. Adding an "else" clause with a fake initialization shuts up the warning. Signed-off-by: Arnd Bergmann --- drivers/scsi/aha1542.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.7.0 diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c index 5b8b2937a3fe..7db448ec8beb 100644 --- a/drivers/scsi/aha1542.c +++ b/drivers/scsi/aha1542.c @@ -403,6 +403,9 @@ static int aha1542_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *cmd) cptr = kmalloc(sizeof(*cptr) * sg_count, GFP_KERNEL | GFP_DMA); if (!cptr) return SCSI_MLQUEUE_HOST_BUSY; + } else { + sg_count = 0; + cptr = NULL; } /* Use the outgoing mailboxes in a round-robin fashion, because this From patchwork Wed Jan 27 15:57:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101060 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2664445lbb; Wed, 27 Jan 2016 08:00:19 -0800 (PST) X-Received: by 10.98.1.21 with SMTP id 21mr43432513pfb.8.1453910419318; Wed, 27 Jan 2016 08:00:19 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f17si10246274pfd.163.2016.01.27.08.00.18; Wed, 27 Jan 2016 08:00:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934020AbcA0QAR (ORCPT + 30 others); Wed, 27 Jan 2016 11:00:17 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:60206 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754867AbcA0QAJ (ORCPT ); Wed, 27 Jan 2016 11:00:09 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0LilTh-1ZoIGp1cb7-00cuuS; Wed, 27 Jan 2016 16:59:18 +0100 From: Arnd Bergmann To: "Martin K. Petersen" , James.Bottomley@HansenPartnership.com Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , linux-scsi@vger.kernel.org, "James E.J. Bottomley" , Mike Snitzer , Hannes Reinecke , linux-kernel@vger.kernel.org Subject: [PATCH 7/7] scsi_dh: force modular build if SCSI is a module Date: Wed, 27 Jan 2016 16:57:23 +0100 Message-Id: <1453910247-3447628-8-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1453910247-3447628-1-git-send-email-arnd@arndb.de> References: <1453910247-3447628-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:jv3alVpEP3rp+wGigudnXRaLUICW6kpJmTnJqnkI6jK+Xz7QVAU 0vw6D7/dZDMESP/1RjMN0w4VvNhhQ7FfG4K5GkLvMzPMAZtH/4UMUDNKUhbytI6R49FIZGG lqUw21nshyAUkiVzXvorjOHXkwaEdUl3wRk4JJk2dEUi5SQ8SYH/KXWFaRC7BKWzSNQtmOQ QosJ6eYCECELQzLjRMPYQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:3dQ1g9Og6eM=:KD9jL70jzWwk1k18vwPUH3 jzB8xQ92726RHWNiDH+KIfpZW4A70ldQM2UAdvacw4TEOrrUOdLjhe9NhX8AFX3Dn9hVlsg9D l4xCyK13OQiLxdwqM9ggA5cYnPIqqtyMPRnLk0/wbYdMBVlQ47WO78OdirkfjZJWtZRVq3PcD QrpavKsrCWlSHuuc/OaEKIIk3pwXw7TGsqIgEz5ki+gwMhPGwqbjG0wodvpvwMdsBkJ/+Bv2a jkJKa/hIr2bfElA1xLcqwSxZNd1heO5+IvbJHQ2oaV0LzoNsss00rPYnbS4kg3GW2jxvPg5ch Oz+3Qe4ZatzagqO2bwkIWR4WPP7edD2QbL0eUQtOEPQFOP4qUsnD2rif7e3CazYdE3E4OLejW 2DrxoG5qvwY7mNez2xA/lOHKn9Cz9UR5LVmDJotm1NBGEBiHT3DQW57sAhw/sBuRrjBP2TC4i wV8b5u0XFZ0OwAD6K2wjUeqLcpSqsWPWlwFpij9VBS5rhfHG/2ve2WQyEFYpBtAwNqGT82lDn Bkw9J7dCHlAEx8PUkXEuURLMnFQEhrxJcNzlPgzAtZ8WMu9FUTHdQwpYmBU4mNe2SLiVykvZ4 9jKgRoEWJ9G6edc9wwGxkoLy5APDTk7PdUNnVtOBZ0sxHj6Q5AKZd6x2EAVTwhk6ROkNj8GP2 DnaruX6IH3+98tgstZJSra4odGE+U4S2PugALQ58ecijcRpnxz0DLIi/ZJZH2aPQPZOg= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the scsi_dh core was moved into the scsi core module, CONFIG_SCSI_DH became a 'bool' option, and now anything depending on it can be built-in even when CONFIG_SCSI=m. This of course cannot link successfully: drivers/scsi/built-in.o: In function `rdac_init': scsi_dh_alua.c:(.init.text+0x14): undefined reference to `scsi_register_device_handler' scsi_dh_alua.c:(.init.text+0x64): undefined reference to `scsi_unregister_device_handler' drivers/scsi/built-in.o: In function `alua_init': scsi_dh_alua.c:(.init.text+0xb0): undefined reference to `scsi_register_device_handler' As a workaround, this adds an extra dependency on CONFIG_SCSI, so Kconfig can figure out whether built-in is allowed or not. Signed-off-by: Arnd Bergmann Fixes: 086b91d052eb ("scsi_dh: integrate into the core SCSI code") --- drivers/scsi/device_handler/Kconfig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.7.0 diff --git a/drivers/scsi/device_handler/Kconfig b/drivers/scsi/device_handler/Kconfig index e5647d59224f..0b331c9c0a8f 100644 --- a/drivers/scsi/device_handler/Kconfig +++ b/drivers/scsi/device_handler/Kconfig @@ -13,13 +13,13 @@ menuconfig SCSI_DH config SCSI_DH_RDAC tristate "LSI RDAC Device Handler" - depends on SCSI_DH + depends on SCSI_DH && SCSI help If you have a LSI RDAC select y. Otherwise, say N. config SCSI_DH_HP_SW tristate "HP/COMPAQ MSA Device Handler" - depends on SCSI_DH + depends on SCSI_DH && SCSI help If you have a HP/COMPAQ MSA device that requires START_STOP to be sent to start it and cannot upgrade the firmware then select y. @@ -27,13 +27,13 @@ config SCSI_DH_HP_SW config SCSI_DH_EMC tristate "EMC CLARiiON Device Handler" - depends on SCSI_DH + depends on SCSI_DH && SCSI help If you have a EMC CLARiiON select y. Otherwise, say N. config SCSI_DH_ALUA tristate "SPC-3 ALUA Device Handler" - depends on SCSI_DH + depends on SCSI_DH && SCSI help SCSI Device handler for generic SPC-3 Asymmetric Logical Unit Access (ALUA).