From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-by2nam03on0132.outbound.protection.outlook.com ([104.47.42.132]:24496 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032515AbeCAPhp (ORCPT ); Thu, 1 Mar 2018 10:37:45 -0500 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Arnd Bergmann , "Martin K . Petersen" , Sasha Levin Subject: [added to the 4.1 stable tree] scsi: advansys: fix build warning for PCI=n Date: Thu, 1 Mar 2018 15:27:07 +0000 Message-ID: <20180301152116.1486-433-alexander.levin@microsoft.com> References: <20180301152116.1486-1-alexander.levin@microsoft.com> In-Reply-To: <20180301152116.1486-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Arnd Bergmann This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ Upstream commit f46e7cd36b5f2ce2bfb567e278a10ca717f85b84 ] The advansys probe function tries to handle both ISA and PCI cases, each hidden in an #ifdef when unused. This leads to a warning indicating that when PCI is disabled we could be using uninitialized data: drivers/scsi/advansys.c: In function advansys_board_found : drivers/scsi/advansys.c:11036:5: error: ret may be used uninitialized in = this function [-Werror=3Dmaybe-uninitialized] drivers/scsi/advansys.c:10928:28: note: ret was declared here drivers/scsi/advansys.c:11309:8: error: share_irq may be used uninitializ= ed in this function [-Werror=3Dmaybe-uninitialized] drivers/scsi/advansys.c:10928:6: note: share_irq was declared here This cannot happen in practice because the hardware in question only exists for PCI, but changing the code to just error out here is better for consistency and avoids the warning. Signed-off-by: Arnd Bergmann Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/advansys.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index ae95e347f37d..969469261353 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c @@ -11476,6 +11476,9 @@ static int advansys_board_found(struct Scsi_Host *s= host, unsigned int iop, ASC_DBG(2, "AdvInitGetConfig()\n"); =20 ret =3D AdvInitGetConfig(pdev, shost) ? -ENODEV : 0; +#else + share_irq =3D 0; + ret =3D -ENODEV; #endif /* CONFIG_PCI */ } =20 --=20 2.14.1