From patchwork Tue Jul 21 16:41:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 246913 Delivered-To: patch@linaro.org Received: by 2002:a54:2c11:0:0:0:0:0 with SMTP id g17csp2711691ecp; Tue, 21 Jul 2020 09:43:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsDIVeDDAYR5JIJbaHdDy1lK6thz29PGv7CWYInM0NsOVZEOWEks9vHycPeJR5teTfOMbB X-Received: by 2002:a17:906:3b44:: with SMTP id h4mr27854654ejf.89.1595349783541; Tue, 21 Jul 2020 09:43:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595349783; cv=none; d=google.com; s=arc-20160816; b=SDz8N8KGgR0ulpma7ub/e6KmhtMSAx4cRcV92YASjrqkx34atSlu8OsaN289cj9Mx/ zQDhXbwBBc43P7Lw7biCVFpBpcfSgn9LPWQfqSPpu92f5cWLWUO/JIewb40lpcZS82R9 Gxm/Tsdes4WlUn3+u2YoWwR2KXpOte7VcMAiiWRbJycAdOFC9zK+eRY0WVjAEvWymaNo Isfszo8/2PezFpZI1+8dG7J9IfVkxsuhdV38T0lJZPSOKt6/zdr+a9SPP1TWnaellf5b pp+6ouSbma4+5NWRFy9etm27cFOm0ATeGbxjUojahLG15/UXdo/fkekXszBsEqwf3AeX 9sOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Y0yJDqT6Xp8JtjeqnfKAiYDb/27vGgP/5g9qR0UQVcc=; b=hc2N4BL/H0x0T8uMcJ4cl70q0oXfGGW2HnU0D7naQFzSX6FQ0Y3P/aWGncSNqoxovV ALj3tpryXlxmVx7rOMquFvOW46elTDUMnrB4Iw33dzh5BUHWgedRfWsWcnTsNsBWIu/K nH/l/NFfntPDcUdcAgjk/B3+twYTk7xmQnCIQaY55wwi230j6dBpcDBhzO8j79H5avt0 y41+psif9U9xOMVJeli3X2IBSClnf3eSO2oqqNGNU4YF92lj+Xz1+t5tJ2E8hdVM0jnG VOFP2kwkT9vdUYxxQMeB1i6DFfMSlYk2ZDQzTVszJsSZ1qhhrAzy1YAKWspkQ+/3VaU5 n7/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vpj7nJwM; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c10si12788297ejs.1.2020.07.21.09.43.03 for ; Tue, 21 Jul 2020 09:43:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vpj7nJwM; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730817AbgGUQm7 (ORCPT ); Tue, 21 Jul 2020 12:42:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730803AbgGUQmx (ORCPT ); Tue, 21 Jul 2020 12:42:53 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CEF7C0619DA for ; Tue, 21 Jul 2020 09:42:53 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id 22so3481783wmg.1 for ; Tue, 21 Jul 2020 09:42:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Y0yJDqT6Xp8JtjeqnfKAiYDb/27vGgP/5g9qR0UQVcc=; b=vpj7nJwMcmyqh1hH5dO2AgjOuj9y6uO8GlHINh7dZQyfXyUKHXtajYv84lf5KlXu8E YUqLkcXi7DQt4zYaUzH5uDysC28gKvYB4oKOnAR1T6phHAD+OGZ5ivxN/jxeiKtduU7O EDTKN6B67YiCWMAj/CEKHHa9B0Budc621JejRk65Vu9VBT3ZF4X+3sHHl9BR63WmUAEX 0arouQ5cpcJRcUIDThTpMmYq8RsvAFBAO9WRZIUTesy2HEVcI/Xl66We4IwA8g+8tms6 cLG0uWP4bFPo7MuSkX+YgsNChi/DFOC03SHrTrJP0MnoRA4GHuJPpAWfdAL+8IDjCQXn pCnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Y0yJDqT6Xp8JtjeqnfKAiYDb/27vGgP/5g9qR0UQVcc=; b=gGqZVS2oHI/uDFLV+FaxFc0kpdcJVND6R4DfJtdzKe6rQ8zSYP78t8mVxAk3UL5XLZ gpDUysW1ubTEXKXzs3v++af2ZZmDLj4XmcHn6zTzE7KaQHJCsRpAiQCnfnc9q3MlQd2r OJtHI1/fDwp2W5taTnTEVWwaF0xJxO8B37pREu5b2++/nVmuHjoAr2fov372rSuqTZ6G kd9bFyYC48zi2wV34vzOy+ncCIldZa55DMs+WPj+gFI6aIlO2FU7wZF9adIHmIDl68fq 4PFAYtKSQl2mTML14LF6tD46Vp8K61IUq613i6l21aChaiyy7py0ap2DrR9R52L7aUV+ zRxg== X-Gm-Message-State: AOAM5335Sbg+8nQqUbQ4sMRYjBUprPSJg8bTlZ6Ty14//WRexyao0Xf4 xg/xWUFWcSIa/+yVxbefnO0cQA== X-Received: by 2002:a7b:c8c8:: with SMTP id f8mr5020503wml.142.1595349771749; Tue, 21 Jul 2020 09:42:51 -0700 (PDT) Received: from localhost.localdomain ([2.27.167.94]) by smtp.gmail.com with ESMTPSA id m4sm3933524wmi.48.2020.07.21.09.42.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 09:42:51 -0700 (PDT) From: Lee Jones To: jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, Lee Jones , Jason Yan , Marvell , Jeff Garzik Subject: [PATCH 39/40] scsi: mvsas: mv_init: Move 'core_nr' inside #ifdef and remove unused variable 'res_flag' Date: Tue, 21 Jul 2020 17:41:47 +0100 Message-Id: <20200721164148.2617584-40-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200721164148.2617584-1-lee.jones@linaro.org> References: <20200721164148.2617584-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Only declare 'core_nr' if its conditions for use are met. Fixes the following W=1 kernel build warning(s): drivers/scsi/mvsas/mv_init.c: In function ‘mvs_interrupt’: drivers/scsi/mvsas/mv_init.c:180:6: warning: variable ‘core_nr’ set but not used [-Wunused-but-set-variable] drivers/scsi/mvsas/mv_init.c: In function ‘mvs_ioremap’: drivers/scsi/mvsas/mv_init.c:302:36: warning: variable ‘res_flag’ set but not used [-Wunused-but-set-variable] Cc: Jason Yan Cc: Marvell Cc: Jeff Garzik Signed-off-by: Lee Jones --- drivers/scsi/mvsas/mv_init.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 2.25.1 diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c index b0de3bdb01db0..3b450319cc11e 100644 --- a/drivers/scsi/mvsas/mv_init.c +++ b/drivers/scsi/mvsas/mv_init.c @@ -177,15 +177,17 @@ static void mvs_tasklet(unsigned long opaque) static irqreturn_t mvs_interrupt(int irq, void *opaque) { - u32 core_nr; u32 stat; struct mvs_info *mvi; struct sas_ha_struct *sha = opaque; #ifndef CONFIG_SCSI_MVSAS_TASKLET u32 i; -#endif +#else + u32 core_nr; core_nr = ((struct mvs_prv_info *)sha->lldd_ha)->n_host; +#endif + mvi = ((struct mvs_prv_info *)sha->lldd_ha)->mvi[0]; if (unlikely(!mvi)) @@ -299,7 +301,7 @@ static int mvs_alloc(struct mvs_info *mvi, struct Scsi_Host *shost) int mvs_ioremap(struct mvs_info *mvi, int bar, int bar_ex) { - unsigned long res_start, res_len, res_flag, res_flag_ex = 0; + unsigned long res_start, res_len, res_flag_ex = 0; struct pci_dev *pdev = mvi->pdev; if (bar_ex != -1) { /* @@ -327,7 +329,6 @@ int mvs_ioremap(struct mvs_info *mvi, int bar, int bar_ex) goto err_out; } - res_flag = pci_resource_flags(pdev, bar); mvi->regs = ioremap(res_start, res_len); if (!mvi->regs) {