linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: jejb@linux.ibm.com, martin.petersen@oracle.com
Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
	Lee Jones <lee.jones@linaro.org>, Brian King <brking@us.ibm.com>
Subject: [PATCH v2 13/24] scsi: ipr: Remove a bunch of set but checked variables
Date: Mon, 13 Jul 2020 08:59:50 +0100	[thread overview]
Message-ID: <20200713080001.128044-14-lee.jones@linaro.org> (raw)
In-Reply-To: <20200713080001.128044-1-lee.jones@linaro.org>

Fixes the following W=1 kernel build warning(s):

In file included from  drivers/scsi/ipr.c:73:
 drivers/scsi/ipr.c: In function ‘ipr_mask_and_clear_interrupts’:
 drivers/scsi/ipr.c:740:15: warning: variable ‘int_reg’ set but not used [-Wunused-but-set-variable]
 drivers/scsi/ipr.c: In function ‘ipr_cancel_op’:
 drivers/scsi/ipr.c:5497:13: warning: variable ‘int_reg’ set but not used [-Wunused-but-set-variable]
 drivers/scsi/ipr.c: In function ‘ipr_iopoll’:
 drivers/scsi/ipr.c:5765:22: warning: variable ‘ioa_cfg’ set but not used [-Wunused-but-set-variable]
 drivers/scsi/ipr.c: In function ‘ipr_reset_restore_cfg_space’:
 drivers/scsi/ipr.c:8662:6: warning: variable ‘int_reg’ set but not used [-Wunused-but-set-variable]
 drivers/scsi/ipr.c: In function ‘ipr_test_msi’:

Cc: Brian King <brking@us.ibm.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/scsi/ipr.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index f85020904099e..b0aa58d117cc9 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -738,7 +738,6 @@ struct ipr_cmnd *ipr_get_free_ipr_cmnd(struct ipr_ioa_cfg *ioa_cfg)
 static void ipr_mask_and_clear_interrupts(struct ipr_ioa_cfg *ioa_cfg,
 					  u32 clr_ints)
 {
-	volatile u32 int_reg;
 	int i;
 
 	/* Stop new interrupts */
@@ -758,7 +757,7 @@ static void ipr_mask_and_clear_interrupts(struct ipr_ioa_cfg *ioa_cfg,
 	if (ioa_cfg->sis64)
 		writel(~0, ioa_cfg->regs.clr_interrupt_reg);
 	writel(clr_ints, ioa_cfg->regs.clr_interrupt_reg32);
-	int_reg = readl(ioa_cfg->regs.sense_interrupt_reg);
+	readl(ioa_cfg->regs.sense_interrupt_reg);
 }
 
 /**
@@ -5510,7 +5509,7 @@ static int ipr_cancel_op(struct scsi_cmnd *scsi_cmd)
 	struct ipr_ioa_cfg *ioa_cfg;
 	struct ipr_resource_entry *res;
 	struct ipr_cmd_pkt *cmd_pkt;
-	u32 ioasc, int_reg;
+	u32 ioasc;
 	int i, op_found = 0;
 	struct ipr_hrr_queue *hrrq;
 
@@ -5533,7 +5532,7 @@ static int ipr_cancel_op(struct scsi_cmnd *scsi_cmd)
 	 * by a still not detected EEH error. In such cases, reading a register will
 	 * trigger the EEH recovery infrastructure.
 	 */
-	int_reg = readl(ioa_cfg->regs.sense_interrupt_reg);
+	readl(ioa_cfg->regs.sense_interrupt_reg);
 
 	if (!ipr_is_gscsi(res))
 		return FAILED;
@@ -5780,7 +5779,6 @@ static int ipr_process_hrrq(struct ipr_hrr_queue *hrr_queue, int budget,
 
 static int ipr_iopoll(struct irq_poll *iop, int budget)
 {
-	struct ipr_ioa_cfg *ioa_cfg;
 	struct ipr_hrr_queue *hrrq;
 	struct ipr_cmnd *ipr_cmd, *temp;
 	unsigned long hrrq_flags;
@@ -5788,7 +5786,6 @@ static int ipr_iopoll(struct irq_poll *iop, int budget)
 	LIST_HEAD(doneq);
 
 	hrrq = container_of(iop, struct ipr_hrr_queue, iopoll);
-	ioa_cfg = hrrq->ioa_cfg;
 
 	spin_lock_irqsave(hrrq->lock, hrrq_flags);
 	completed_ops = ipr_process_hrrq(hrrq, budget, &doneq);
@@ -8681,7 +8678,6 @@ static int ipr_dump_mailbox_wait(struct ipr_cmnd *ipr_cmd)
 static int ipr_reset_restore_cfg_space(struct ipr_cmnd *ipr_cmd)
 {
 	struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
-	u32 int_reg;
 
 	ENTER;
 	ioa_cfg->pdev->state_saved = true;
@@ -8697,7 +8693,7 @@ static int ipr_reset_restore_cfg_space(struct ipr_cmnd *ipr_cmd)
 	if (ioa_cfg->sis64) {
 		/* Set the adapter to the correct endian mode. */
 		writel(IPR_ENDIAN_SWAP_KEY, ioa_cfg->regs.endian_swap_reg);
-		int_reg = readl(ioa_cfg->regs.endian_swap_reg);
+		readl(ioa_cfg->regs.endian_swap_reg);
 	}
 
 	if (ioa_cfg->ioa_unit_checked) {
@@ -10120,7 +10116,6 @@ static irqreturn_t ipr_test_intr(int irq, void *devp)
 static int ipr_test_msi(struct ipr_ioa_cfg *ioa_cfg, struct pci_dev *pdev)
 {
 	int rc;
-	volatile u32 int_reg;
 	unsigned long lock_flags = 0;
 	int irq = pci_irq_vector(pdev, 0);
 
@@ -10131,7 +10126,7 @@ static int ipr_test_msi(struct ipr_ioa_cfg *ioa_cfg, struct pci_dev *pdev)
 	ioa_cfg->msi_received = 0;
 	ipr_mask_and_clear_interrupts(ioa_cfg, ~IPR_PCII_IOA_TRANS_TO_OPER);
 	writel(IPR_PCII_IO_DEBUG_ACKNOWLEDGE, ioa_cfg->regs.clr_interrupt_mask_reg32);
-	int_reg = readl(ioa_cfg->regs.sense_interrupt_mask_reg);
+	readl(ioa_cfg->regs.sense_interrupt_mask_reg);
 	spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
 
 	rc = request_irq(irq, ipr_test_intr, 0, IPR_NAME, ioa_cfg);
@@ -10142,7 +10137,7 @@ static int ipr_test_msi(struct ipr_ioa_cfg *ioa_cfg, struct pci_dev *pdev)
 		dev_info(&pdev->dev, "IRQ assigned: %d\n", irq);
 
 	writel(IPR_PCII_IO_DEBUG_ACKNOWLEDGE, ioa_cfg->regs.sense_interrupt_reg32);
-	int_reg = readl(ioa_cfg->regs.sense_interrupt_reg);
+	readl(ioa_cfg->regs.sense_interrupt_reg);
 	wait_event_timeout(ioa_cfg->msi_wait_q, ioa_cfg->msi_received, HZ);
 	spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
 	ipr_mask_and_clear_interrupts(ioa_cfg, ~IPR_PCII_IOA_TRANS_TO_OPER);
-- 
2.25.1


  parent reply	other threads:[~2020-07-13  8:00 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-13  7:59 [PATCH v2 00/24] Set 3: Fix another set of SCSI related W=1 warnings Lee Jones
2020-07-13  7:59 ` [PATCH v2 01/24] scsi: aacraid: aachba: Repair two kerneldoc headers Lee Jones
2020-07-13  7:59 ` [PATCH v2 02/24] scsi: aacraid: commctrl: Fix a few kerneldoc issues Lee Jones
2020-07-13  7:59 ` [PATCH v2 03/24] scsi: aacraid: dpcsup: Fix logical bug when !DBG Lee Jones
2020-07-13  7:59 ` [PATCH v2 04/24] scsi: aacraid: dpcsup: Remove unused variable 'status' Lee Jones
2020-07-13  7:59 ` [PATCH v2 05/24] scsi: aacraid: dpcsup: Demote partially documented function header Lee Jones
2020-07-13  7:59 ` [PATCH v2 06/24] scsi: aic94xx: aic94xx_seq: Document 'lseq' and repair asd_update_port_links() header Lee Jones
2020-07-13  7:59 ` [PATCH v2 07/24] scsi: aacraid: commsup: Fix a bunch of function header issues Lee Jones
2020-07-13  7:59 ` [PATCH v2 08/24] scsi: aic94xx: aic94xx_scb: Fix a couple of formatting and bitrot issues Lee Jones
2020-07-13  7:59 ` [PATCH v2 09/24] scsi: aacraid: rx: Fill in the very parameter descriptions for rx_sync_cmd() Lee Jones
2020-07-13  7:59 ` [PATCH v2 10/24] scsi: pm8001: pm8001_ctl: Provide descriptions for the many undocumented 'attr's Lee Jones
2020-07-13  8:18   ` Jinpu Wang
2020-07-13  7:59 ` [PATCH v2 11/24] scsi: ipr: Fix a mountain of kerneldoc misdemeanours Lee Jones
2020-07-13  7:59 ` [PATCH v2 12/24] scsi: virtio_scsi: Demote seemingly unintentional kerneldoc header Lee Jones
2020-07-13 11:23   ` Michael S. Tsirkin
2020-07-13 11:53     ` Lee Jones
2020-07-13  7:59 ` Lee Jones [this message]
2020-07-13  7:59 ` [PATCH v2 14/24] scsi: ipr: Fix struct packed-not-aligned issues Lee Jones
2020-07-13  7:59 ` [PATCH v2 15/24] scsi: myrs: Demote obvious misuse of kerneldoc to standard comment blocks Lee Jones
2020-07-14  7:45   ` Hannes Reinecke
2020-07-14  8:49     ` Lee Jones
2020-07-13  7:59 ` [PATCH v2 16/24] scsi: megaraid: Fix a whole bunch of function header formatting issues Lee Jones
2020-07-13  7:59 ` [PATCH v2 17/24] scsi: be2iscsi: be_iscsi: Fix API/documentation slip Lee Jones
2020-07-13  7:59 ` [PATCH v2 18/24] scsi: be2iscsi: be_main: Fix misdocumentation of 'pcontext' Lee Jones
2020-07-13  7:59 ` [PATCH v2 19/24] scsi: be2iscsi: be_mgmt: Add missing function parameter description Lee Jones
2020-07-13  7:59 ` [PATCH v2 20/24] scsi: lpfc: lpfc_nvme: Correct some pretty obvious misdocumentation Lee Jones
2020-07-13  7:59 ` [PATCH v2 21/24] scsi: aic7xxx: aic79xx_osm: Remove unused variable 'ahd' Lee Jones
2020-07-14  7:47   ` Hannes Reinecke
2020-07-13  7:59 ` [PATCH v2 22/24] scsi: aic7xxx: aic79xx_osm: Remove unused variables 'wait' and 'paused' Lee Jones
2020-07-14  7:47   ` Hannes Reinecke
2020-07-13  8:00 ` [PATCH v2 23/24] scsi: aic7xxx: aic79xx_osm: Fix 'amount_xferred' set but not used issue Lee Jones
2020-07-14  7:47   ` Hannes Reinecke
2020-07-13  8:00 ` [PATCH v2 24/24] scsi: aic7xxx: aic79xx_osm: Remove set but unused variabes 'saved_scsiid' and 'saved_modes' Lee Jones
2020-07-14  7:46   ` Hannes Reinecke
2020-07-14 15:43     ` James Bottomley
2020-07-14 21:39       ` Lee Jones
2020-07-14 23:03         ` James Bottomley
2020-07-15  6:29           ` Lee Jones
2020-07-21  6:38           ` Hannes Reinecke
2020-07-15  5:58         ` Hannes Reinecke
2020-07-15  6:30           ` Lee Jones
2020-07-15 22:14 ` [PATCH v2 00/24] Set 3: Fix another set of SCSI related W=1 warnings Martin K. Petersen
2020-07-16  7:14   ` Lee Jones
2020-07-16  7:16   ` Lee Jones
2020-07-16  8:00     ` Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200713080001.128044-14-lee.jones@linaro.org \
    --to=lee.jones@linaro.org \
    --cc=brking@us.ibm.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).