[PATCH 18/40] scsi: pm8001: pm8001_hwi: Remove a bunch of set but unused variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

 drivers/scsi/qla4xxx/ql4_os.c: In function ‘qla4xxx_eh_cmd_timed_out’:
 drivers/scsi/qla4xxx/ql4_os.c:1865:24: warning: variable ‘sess’ set but not used [-Wunused-but-set-variable]
 1865 | struct iscsi_session *sess;
 | ^~~~
 drivers/scsi/qla4xxx/ql4_os.c: In function ‘qla4xxx_session_create’:
 drivers/scsi/qla4xxx/ql4_os.c:3079:19: warning: variable ‘dst_addr’ set but not used [-Wunused-but-set-variable]
 3079 | struct sockaddr *dst_addr;
 | ^~~~~~~~
 drivers/scsi/qla4xxx/ql4_os.c: In function ‘qla4_8xxx_iospace_config’:
 drivers/scsi/qla4xxx/ql4_os.c:5512:44: warning: variable ‘db_len’ set but not used [-Wunused-but-set-variable]
 5512 | unsigned long mem_base, mem_len, db_base, db_len;
 | ^~~~~~
 drivers/scsi/qla4xxx/ql4_os.c:5512:35: warning: variable ‘db_base’ set but not used [-Wunused-but-set-variable]
 5512 | unsigned long mem_base, mem_len, db_base, db_len;
 | ^~~~~~~
 drivers/scsi/qla4xxx/ql4_os.c: In function ‘qla4xxx_get_param_ddb’:
 drivers/scsi/qla4xxx/ql4_os.c:6269:24: warning: variable ‘ha’ set but not used [-Wunused-but-set-variable]
 6269 | struct scsi_qla_host *ha;
 | ^~

Cc: Jack Wang <jinpu.wang@xxxxxxxxxxxxxxx>
Signed-off-by: Lee Jones <lee.jones@xxxxxxxxxx>
---
 drivers/scsi/pm8001/pm8001_hwi.c |  6 +++---
 drivers/scsi/qla4xxx/ql4_os.c    | 11 +----------
 2 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
index 6323016e1304e..e9a939230b152 100644
--- a/drivers/scsi/pm8001/pm8001_hwi.c
+++ b/drivers/scsi/pm8001/pm8001_hwi.c
@@ -4645,8 +4645,8 @@ int pm8001_chip_dereg_dev_req(struct pm8001_hba_info *pm8001_ha,
 /**
  * pm8001_chip_phy_ctl_req - support the local phy operation
  * @pm8001_ha: our hba card information.
- * @phy_id: the phy id which we wanted to operate
- * @phy_op:
+ * @phyId: the phy id which we wanted to operate
+ * @phy_op: the phy operation to request
  */
 static int pm8001_chip_phy_ctl_req(struct pm8001_hba_info *pm8001_ha,
 	u32 phyId, u32 phy_op)
@@ -4682,7 +4682,7 @@ static u32 pm8001_chip_is_our_interrupt(struct pm8001_hba_info *pm8001_ha)
 /**
  * pm8001_chip_isr - PM8001 isr handler.
  * @pm8001_ha: our hba card information.
- * @stat: stat.
+ * @vec: IRQ number
  */
 static irqreturn_t
 pm8001_chip_isr(struct pm8001_hba_info *pm8001_ha, u8 vec)
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 97fa290cf295f..27064c602dc70 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -1862,12 +1862,10 @@ static void qla4xxx_conn_get_stats(struct iscsi_cls_conn *cls_conn,
 static enum blk_eh_timer_return qla4xxx_eh_cmd_timed_out(struct scsi_cmnd *sc)
 {
 	struct iscsi_cls_session *session;
-	struct iscsi_session *sess;
 	unsigned long flags;
 	enum blk_eh_timer_return ret = BLK_EH_DONE;
 
 	session = starget_to_session(scsi_target(sc->device));
-	sess = session->dd_data;
 
 	spin_lock_irqsave(&session->lock, flags);
 	if (session->state == ISCSI_SESSION_FAILED)
@@ -3076,7 +3074,6 @@ qla4xxx_session_create(struct iscsi_endpoint *ep,
 	struct ddb_entry *ddb_entry;
 	uint16_t ddb_index;
 	struct iscsi_session *sess;
-	struct sockaddr *dst_addr;
 	int ret;
 
 	if (!ep) {
@@ -3085,7 +3082,6 @@ qla4xxx_session_create(struct iscsi_endpoint *ep,
 	}
 
 	qla_ep = ep->dd_data;
-	dst_addr = (struct sockaddr *)&qla_ep->dst_addr;
 	ha = to_qla_host(qla_ep->host);
 	DEBUG2(ql4_printk(KERN_INFO, ha, "%s: host: %ld\n", __func__,
 			  ha->host_no));
@@ -5509,7 +5505,7 @@ static void qla4xxx_free_adapter(struct scsi_qla_host *ha)
 int qla4_8xxx_iospace_config(struct scsi_qla_host *ha)
 {
 	int status = 0;
-	unsigned long mem_base, mem_len, db_base, db_len;
+	unsigned long mem_base, mem_len;
 	struct pci_dev *pdev = ha->pdev;
 
 	status = pci_request_regions(pdev, DRIVER_NAME);
@@ -5553,9 +5549,6 @@ int qla4_8xxx_iospace_config(struct scsi_qla_host *ha)
 				    ((uint8_t *)ha->nx_pcibase);
 	}
 
-	db_base = pci_resource_start(pdev, 4);  /* doorbell is on bar 4 */
-	db_len = pci_resource_len(pdev, 4);
-
 	return 0;
 iospace_error_exit:
 	return -ENOMEM;
@@ -6266,14 +6259,12 @@ static int qla4xxx_setup_boot_info(struct scsi_qla_host *ha)
 static void qla4xxx_get_param_ddb(struct ddb_entry *ddb_entry,
 				  struct ql4_tuple_ddb *tddb)
 {
-	struct scsi_qla_host *ha;
 	struct iscsi_cls_session *cls_sess;
 	struct iscsi_cls_conn *cls_conn;
 	struct iscsi_session *sess;
 	struct iscsi_conn *conn;
 
 	DEBUG2(printk(KERN_INFO "Func: %s\n", __func__));
-	ha = ddb_entry->ha;
 	cls_sess = ddb_entry->sess;
 	sess = cls_sess->dd_data;
 	cls_conn = ddb_entry->conn;
-- 
2.25.1




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux