From patchwork Wed Jun 24 08:29:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 6666241 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DA8869F380 for ; Wed, 24 Jun 2015 08:30:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 048E120623 for ; Wed, 24 Jun 2015 08:30:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 27B6E2061D for ; Wed, 24 Jun 2015 08:30:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751986AbbFXI36 (ORCPT ); Wed, 24 Jun 2015 04:29:58 -0400 Received: from michel.telenet-ops.be ([195.130.137.88]:57117 "EHLO michel.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751731AbbFXI3x (ORCPT ); Wed, 24 Jun 2015 04:29:53 -0400 Received: from ayla.of.borg ([84.193.93.87]) by michel.telenet-ops.be with bizsmtp id k8Vr1q00N1t5w8s068Vrao; Wed, 24 Jun 2015 10:29:52 +0200 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1Z7g47-00064Q-K3; Wed, 24 Jun 2015 10:29:51 +0200 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1Z7g4A-0004KS-1t; Wed, 24 Jun 2015 10:29:54 +0200 From: Geert Uytterhoeven To: Matthew Wilcox , Hannes Reinecke , "James E.J. Bottomley" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 2/2] advansys: Make sure ret and share_irq are initialized Date: Wed, 24 Jun 2015 10:29:49 +0200 Message-Id: <1435134589-16601-2-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1435134589-16601-1-git-send-email-geert@linux-m68k.org> References: <1435134589-16601-1-git-send-email-geert@linux-m68k.org> MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If CONFIG_PCI=n: drivers/scsi/advansys.c: In function ‘advansys_board_found’: drivers/scsi/advansys.c:11037: warning: ‘ret’ is used uninitialized in this function drivers/scsi/advansys.c:10929: warning: ‘share_irq’ may be used uninitialized in this function If CONFIG_PCI=n, ret and share_irq are indeed not initialized. Pre-initialize them to zero, and drop the now superfluous setting of share_irq to zero. Note that this is sort-of a false positive, as apparently ASC_NARROW_BOARD(boardp) can only be false for PCI boards, e.g. if CONFIG_PCI=y. Signed-off-by: Geert Uytterhoeven --- drivers/scsi/advansys.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 1c1cd657c380c2e0..a056226d3f35e863 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c @@ -10926,7 +10926,7 @@ static int advansys_board_found(struct Scsi_Host *shost, unsigned int iop, struct asc_board *boardp = shost_priv(shost); ASC_DVC_VAR *asc_dvc_varp = NULL; ADV_DVC_VAR *adv_dvc_varp = NULL; - int share_irq, warn_code, ret; + int share_irq = 0, warn_code, ret = 0; pdev = (bus_type == ASC_IS_PCI) ? to_pci_dev(boardp->dev) : NULL; @@ -10987,11 +10987,9 @@ static int advansys_board_found(struct Scsi_Host *shost, unsigned int iop, #ifdef CONFIG_ISA case ASC_IS_ISA: shost->unchecked_isa_dma = true; - share_irq = 0; break; case ASC_IS_VL: shost->unchecked_isa_dma = false; - share_irq = 0; break; case ASC_IS_EISA: shost->unchecked_isa_dma = false; @@ -11008,7 +11006,6 @@ static int advansys_board_found(struct Scsi_Host *shost, unsigned int iop, shost_printk(KERN_ERR, shost, "unknown adapter type: " "%d\n", asc_dvc_varp->bus_type); shost->unchecked_isa_dma = false; - share_irq = 0; break; }