linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: martin.petersen@oracle.com
Cc: linux-kernel@vger.kernel.org, Lee Jones <lee.jones@linaro.org>,
	Don Brace <don.brace@microchip.com>,
	Bugfixes to <esc.storagedev@microsemi.com>,
	storagedev@microchip.com
Subject: [PATCH 19/19] scsi: hpsa: Strip out a bunch of set but unused variables
Date: Mon,  2 Nov 2020 11:57:28 +0000	[thread overview]
Message-ID: <20201102115728.1077697-20-lee.jones@linaro.org> (raw)
In-Reply-To: <20201102115728.1077697-1-lee.jones@linaro.org>

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

 drivers/scsi/hpsa.c: In function ‘hpsa_volume_offline’:
 drivers/scsi/hpsa.c:3885:5: warning: variable ‘scsi_status’ set but not used [-Wunused-but-set-variable]
 drivers/scsi/hpsa.c:3884:6: warning: variable ‘cmd_status’ set but not used [-Wunused-but-set-variable]
 drivers/scsi/hpsa.c: In function ‘hpsa_update_scsi_devices’:
 drivers/scsi/hpsa.c:4354:9: warning: variable ‘n_ext_target_devs’ set but not used [-Wunused-but-set-variable]
 drivers/scsi/hpsa.c: In function ‘hpsa_scatter_gather’:
 drivers/scsi/hpsa.c:4583:36: warning: variable ‘last_sg’ set but not used [-Wunused-but-set-variable]
 drivers/scsi/hpsa.c: In function ‘hpsa_init_one’:
 drivers/scsi/hpsa.c:8639:6: warning: variable ‘dac’ set but not used [-Wunused-but-set-variable]
 drivers/scsi/hpsa.c: In function ‘hpsa_enter_performant_mode’:
 drivers/scsi/hpsa.c:9300:7: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]

Cc: Don Brace <don.brace@microchip.com>
Cc: Bugfixes to <esc.storagedev@microsemi.com>
Cc: storagedev@microchip.com
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/scsi/hpsa.c | 25 +++++++------------------
 1 file changed, 7 insertions(+), 18 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 16fd378285d27..02e20bed8a484 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -3881,8 +3881,6 @@ static unsigned char hpsa_volume_offline(struct ctlr_info *h,
 	u8 sense_key, asc, ascq;
 	int sense_len;
 	int rc, ldstat = 0;
-	u16 cmd_status;
-	u8 scsi_status;
 #define ASC_LUN_NOT_READY 0x04
 #define ASCQ_LUN_NOT_READY_FORMAT_IN_PROGRESS 0x04
 #define ASCQ_LUN_NOT_READY_INITIALIZING_CMD_REQ 0x02
@@ -3902,8 +3900,6 @@ static unsigned char hpsa_volume_offline(struct ctlr_info *h,
 	else
 		sense_len = c->err_info->SenseLen;
 	decode_sense_data(sense, sense_len, &sense_key, &asc, &ascq);
-	cmd_status = c->err_info->CommandStatus;
-	scsi_status = c->err_info->ScsiStatus;
 	cmd_free(h, c);
 
 	/* Determine the reason for not ready state */
@@ -4351,7 +4347,7 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h)
 	u32 ndev_allocated = 0;
 	struct hpsa_scsi_dev_t **currentsd, *this_device, *tmpdevice;
 	int ncurrent = 0;
-	int i, n_ext_target_devs, ndevs_to_allocate;
+	int i, ndevs_to_allocate;
 	int raid_ctlr_position;
 	bool physical_device;
 	DECLARE_BITMAP(lunzerobits, MAX_EXT_TARGETS);
@@ -4416,7 +4412,6 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h)
 		raid_ctlr_position = nphysicals + nlogicals;
 
 	/* adjust our table of devices */
-	n_ext_target_devs = 0;
 	for (i = 0; i < nphysicals + nlogicals + 1; i++) {
 		u8 *lunaddrbytes, is_OBDR = 0;
 		int rc = 0;
@@ -4580,7 +4575,7 @@ static int hpsa_scatter_gather(struct ctlr_info *h,
 		struct scsi_cmnd *cmd)
 {
 	struct scatterlist *sg;
-	int use_sg, i, sg_limit, chained, last_sg;
+	int use_sg, i, sg_limit, chained;
 	struct SGDescriptor *curr_sg;
 
 	BUG_ON(scsi_sg_count(cmd) > h->maxsgentries);
@@ -4602,7 +4597,6 @@ static int hpsa_scatter_gather(struct ctlr_info *h,
 	curr_sg = cp->SG;
 	chained = use_sg > h->max_cmd_sg_entries;
 	sg_limit = chained ? h->max_cmd_sg_entries - 1 : use_sg;
-	last_sg = scsi_sg_count(cmd) - 1;
 	scsi_for_each_sg(cmd, sg, sg_limit, i) {
 		hpsa_set_sg_descriptor(curr_sg, sg);
 		curr_sg++;
@@ -8635,7 +8629,7 @@ static struct ctlr_info *hpda_alloc_ctlr_info(void)
 
 static int hpsa_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
-	int dac, rc;
+	int rc;
 	struct ctlr_info *h;
 	int try_soft_reset = 0;
 	unsigned long flags;
@@ -8711,13 +8705,9 @@ static int hpsa_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	/* configure PCI DMA stuff */
 	rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
-	if (rc == 0) {
-		dac = 1;
-	} else {
+	if (rc != 0)
 		rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
-		if (rc == 0) {
-			dac = 0;
-		} else {
+		if (rc != 0) {
 			dev_err(&pdev->dev, "no suitable DMA available\n");
 			goto clean3;	/* shost, pci, lu, aer/h */
 		}
@@ -9298,10 +9288,9 @@ static int hpsa_enter_performant_mode(struct ctlr_info *h, u32 trans_support)
 	} else if (trans_support & CFGTBL_Trans_io_accel2) {
 		u64 cfg_offset, cfg_base_addr_index;
 		u32 bft2_offset, cfg_base_addr;
-		int rc;
 
-		rc = hpsa_find_cfg_addrs(h->pdev, h->vaddr, &cfg_base_addr,
-			&cfg_base_addr_index, &cfg_offset);
+		hpsa_find_cfg_addrs(h->pdev, h->vaddr, &cfg_base_addr,
+				    &cfg_base_addr_index, &cfg_offset);
 		BUILD_BUG_ON(offsetof(struct io_accel2_cmd, sg) != 64);
 		bft2[15] = h->ioaccel_maxsg + HPSA_IOACCEL2_HEADER_SZ;
 		calc_bucket_map(bft2, ARRAY_SIZE(bft2), h->ioaccel_maxsg,
-- 
2.25.1


      parent reply	other threads:[~2020-11-02 11:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-02 11:57 [PATCH 00/19] Rid W=1 warnings in SCSI Lee Jones
2020-11-02 11:57 ` [PATCH 01/19] scsi: aic7xxx: aic79xx_osm: Remove unused variable 'saved_scsiid' Lee Jones
2020-11-02 11:57 ` [PATCH 02/19] scsi: mpt3sas: mpt3sas_scsih: Fix function documentation formatting Lee Jones
2020-11-02 11:57 ` [PATCH 03/19] scsi: lpfc: lpfc_scsi: Fix a whole host of kernel-doc issues Lee Jones
2020-11-02 11:57 ` [PATCH 04/19] scsi: lpfc: lpfc_attr: Demote kernel-doc format for redefined functions Lee Jones
2020-11-02 11:57 ` [PATCH 05/19] scsi: lpfc: lpfc_attr: Fix-up a bunch of kernel-doc misdemeanours Lee Jones
2020-11-02 11:57 ` [PATCH 06/19] scsi: lpfc: lpfc_debugfs: Fix a couple of function documentation issues Lee Jones
2020-11-02 11:57 ` [PATCH 07/19] scsi: lpfc: lpfc_bsg: Provide correct documentation for a bunch of functions Lee Jones
2020-11-02 11:57 ` [PATCH 08/19] scsi: esas2r: esas2r_disc: Place brackets around a potentially empty if() Lee Jones
2020-11-02 11:57 ` [PATCH 09/19] scsi: esas2r: esas2r_init: " Lee Jones
2020-11-02 11:57 ` [PATCH 10/19] scsi: lpfc: lpfc_nvme: Remove unused variable 'phba' Lee Jones
2020-11-02 11:57 ` [PATCH 11/19] scsi: ufs: ufshcd: Fix some function doc-rot Lee Jones
2020-11-02 13:08   ` Alim Akhtar
2020-11-02 11:57 ` [PATCH 12/19] scsi: lpfc: lpfc_nvme: Fix some kernel-doc related issues Lee Jones
2020-11-02 11:57 ` [PATCH 13/19] scsi: esas2r: esas2r_int: Add brackets around potentially empty if()s Lee Jones
2020-11-02 11:57 ` [PATCH 14/19] scsi: lpfc: lpfc_nvmet: Fix-up some formatting and doc-rot issues Lee Jones
2020-11-02 11:57 ` [PATCH 15/19] scsi: esas2r: esas2r_main: Demote non-conformant kernel-doc header Lee Jones
2020-11-02 11:57 ` [PATCH 16/19] scsi: advansys: Relocate or remove unused variables Lee Jones
2020-11-02 11:57 ` [PATCH 17/19] scsi: dc395x: Remove a few " Lee Jones
2020-11-02 11:57 ` [PATCH 18/19] scsi: dc395x: Mark 's_stat2' as __maybe_unused Lee Jones
2020-11-02 11:57 ` Lee Jones [this message]

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=20201102115728.1077697-20-lee.jones@linaro.org \
    --to=lee.jones@linaro.org \
    --cc=don.brace@microchip.com \
    --cc=esc.storagedev@microsemi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=storagedev@microchip.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).