All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/18] [Set 3] Rid W=1 warnings in SCSI
@ 2021-03-17  8:56 Lee Jones
  2021-03-17  8:56 ` [PATCH 01/18] scsi: aic94xx: aic94xx_dump: Remove code that has been unused for at least 13 years Lee Jones
                   ` (18 more replies)
  0 siblings, 19 replies; 20+ messages in thread
From: Lee Jones @ 2021-03-17  8:56 UTC (permalink / raw)
  To: lee.jones
  Cc: linux-kernel, Adam Radford, Alan Cox, Andre Hedrick,
	Anil Gurumurthy, Artur Paszkiewicz, Bas Vermeulen, Bradley Grove,
	Brian Macy, c by, Christoph Hellwig, David Chaw, de Melo,
	Doug Ledford, GOTO Masanori, gotom, Hannes Reinecke,
	James E.J. Bottomley, Joel Jacobson, Khalid Aziz,
	Leonard N. Zubkoff, Linux GmbH, linux-scsi, Luben Tuikov,
	Martin K. Petersen, MPT-FusionLinux.pdl, MPT-FusionLinux.pdl,
	Richard Hirst, Sathya Prakash, Sreekanth Reddy,
	Sudarsana Kalluru, Suganath Prabu Subramani, YOKOTA Hiroshi

MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This set contains functional changes.

This set is part of a larger effort attempting to clean-up W=1
kernel builds, which are currently overwhelmingly riddled with
niggly little warnings.

Lee Jones (18):
  scsi: aic94xx: aic94xx_dump: Remove code that has been unused for at
    least 13 years
  scsi: mpt3sas: mpt3sas_scs: Move a little data from the stack onto the
    heap
  scsi: bfa: bfa_fcs_lport: Move a large struct from the stack onto the
    heap
  scsi: esas2r: esas2r_log: Supply __printf(x, y) formatting for
    esas2r_log_master()
  scsi: BusLogic: Supply __printf(x, y) formatting for blogic_msg()
  scsi: nsp32: Supply __printf(x, y) formatting for nsp32_message()
  scsi: initio: Remove unused variable 'prev'
  scsi: a100u2w: Remove unused variable 'bios_phys'
  scsi: myrs: Remove a couple of unused 'status' variables
  scsi: 3w-xxxx: Remove 2 unused variables 'response_que_value' and
    'tw_dev'
  scsi: 3w-9xxx: Remove a few set but unused variables
  scsi: 3w-sas: Remove unused variables 'sglist' and 'tw_dev'
  scsi: nsp32: Remove or exclude unused variables
  scsi: FlashPoint: Remove unused variable 'TID' from
    'FlashPoint_AbortCCB()'
  scsi: sim710: Remove unused variable 'err' from sim710_init()
  scsi: isci: port: Make local function 'port_state_name()' static
  scsi: isci: remote_device: Make local function
    isci_remote_device_wait_for_resume_from_abort() static
  scsi: nsp32: Correct expected types in debug print formatting

 drivers/scsi/3w-9xxx.c               |  14 +-
 drivers/scsi/3w-sas.c                |  10 +-
 drivers/scsi/3w-xxxx.c               |   6 +-
 drivers/scsi/BusLogic.c              |   2 +-
 drivers/scsi/FlashPoint.c            |   4 -
 drivers/scsi/a100u2w.c               |   2 -
 drivers/scsi/aic94xx/aic94xx_dump.c  | 184 ---------------------------
 drivers/scsi/bfa/bfa_fcs_lport.c     |  20 ++-
 drivers/scsi/esas2r/esas2r_log.c     |   7 +
 drivers/scsi/initio.c                |   5 +-
 drivers/scsi/isci/port.c             |   2 +-
 drivers/scsi/isci/remote_device.c    |   2 +-
 drivers/scsi/mpt3sas/mpt3sas_scsih.c |  38 ++++--
 drivers/scsi/myrs.c                  |   6 +-
 drivers/scsi/nsp32.c                 |  31 ++---
 drivers/scsi/sim710.c                |  14 +-
 16 files changed, 77 insertions(+), 270 deletions(-)

Cc: Adam Radford <aradford@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Andre Hedrick <andre@suse.com>
Cc: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Cc: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Cc: Bas Vermeulen <bvermeul@blackstar.xs4all.nl>
Cc: Bradley Grove <linuxdrivers@attotech.com>
Cc: Brian Macy <bmacy@sunshinecomputing.com>
Cc: c by <James.Bottomley@SteelEye.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: David Chaw <david_chaw@adaptec.com>
Cc: de Melo <acme@conectiva.com.br>
Cc: Doug Ledford <dledford@redhat.com>
Cc: GOTO Masanori <gotom@debian.or.jp>
Cc: gotom@debian.org
Cc: Hannes Reinecke <hare@kernel.org>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: Joel Jacobson <linux@3ware.com>
Cc: Khalid Aziz <khalid@gonehiking.org>
Cc: "Leonard N. Zubkoff" <lnz@dandelion.com>
Cc: Linux GmbH <hare@suse.com>
Cc: linux-scsi@vger.kernel.org
Cc: Luben Tuikov <luben_tuikov@adaptec.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: MPT-FusionLinux.pdl@avagotech.com
Cc: MPT-FusionLinux.pdl@broadcom.com
Cc: Richard Hirst <richard@sleepie.demon.co.uk>
Cc: Sathya Prakash <sathya.prakash@broadcom.com>
Cc: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Cc: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
Cc: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
Cc: YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>
-- 
2.27.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 01/18] scsi: aic94xx: aic94xx_dump: Remove code that has been unused for at least 13 years
  2021-03-17  8:56 [PATCH 00/18] [Set 3] Rid W=1 warnings in SCSI Lee Jones
@ 2021-03-17  8:56 ` Lee Jones
  2021-03-17  8:56 ` [PATCH 02/18] scsi: mpt3sas: mpt3sas_scs: Move a little data from the stack onto the heap Lee Jones
                   ` (17 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Lee Jones @ 2021-03-17  8:56 UTC (permalink / raw)
  To: lee.jones
  Cc: linux-kernel, James E.J. Bottomley, Martin K. Petersen,
	David Chaw, Luben Tuikov, linux-scsi

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

 drivers/scsi/aic94xx/aic94xx_dump.c:731: warning: expecting prototype for asd_dump_ddb_site(). Prototype was for asd_dump_target_ddb() instead
 drivers/scsi/aic94xx/aic94xx_dump.c:875: warning: expecting prototype for ads_dump_seq_state(). Prototype was for asd_dump_seq_state() instead

Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: David Chaw <david_chaw@adaptec.com>
Cc: Luben Tuikov <luben_tuikov@adaptec.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/scsi/aic94xx/aic94xx_dump.c | 184 ----------------------------
 1 file changed, 184 deletions(-)

diff --git a/drivers/scsi/aic94xx/aic94xx_dump.c b/drivers/scsi/aic94xx/aic94xx_dump.c
index 7c4c53a54b782..47a663a39dcce 100644
--- a/drivers/scsi/aic94xx/aic94xx_dump.c
+++ b/drivers/scsi/aic94xx/aic94xx_dump.c
@@ -720,152 +720,6 @@ static void asd_dump_lseq_state(struct asd_ha_struct *asd_ha, int lseq)
 	PRINT_LMIP_dword(asd_ha, lseq, DEV_PRES_TIMER_TERM_TS);
 }
 
-#if 0
-
-/**
- * asd_dump_ddb_site -- dump a CSEQ DDB site
- * @asd_ha: pointer to host adapter structure
- * @site_no: site number of interest
- */
-void asd_dump_target_ddb(struct asd_ha_struct *asd_ha, u16 site_no)
-{
-	if (site_no >= asd_ha->hw_prof.max_ddbs)
-		return;
-
-#define DDB_FIELDB(__name)                                        \
-	asd_ddbsite_read_byte(asd_ha, site_no,                    \
-			      offsetof(struct asd_ddb_ssp_smp_target_port, __name))
-#define DDB2_FIELDB(__name)                                       \
-	asd_ddbsite_read_byte(asd_ha, site_no,                    \
-			      offsetof(struct asd_ddb_stp_sata_target_port, __name))
-#define DDB_FIELDW(__name)                                        \
-	asd_ddbsite_read_word(asd_ha, site_no,                    \
-			      offsetof(struct asd_ddb_ssp_smp_target_port, __name))
-
-#define DDB_FIELDD(__name)                                         \
-	asd_ddbsite_read_dword(asd_ha, site_no,                    \
-			       offsetof(struct asd_ddb_ssp_smp_target_port, __name))
-
-	asd_printk("DDB: 0x%02x\n", site_no);
-	asd_printk("conn_type: 0x%02x\n", DDB_FIELDB(conn_type));
-	asd_printk("conn_rate: 0x%02x\n", DDB_FIELDB(conn_rate));
-	asd_printk("init_conn_tag: 0x%04x\n", be16_to_cpu(DDB_FIELDW(init_conn_tag)));
-	asd_printk("send_queue_head: 0x%04x\n", be16_to_cpu(DDB_FIELDW(send_queue_head)));
-	asd_printk("sq_suspended: 0x%02x\n", DDB_FIELDB(sq_suspended));
-	asd_printk("DDB Type: 0x%02x\n", DDB_FIELDB(ddb_type));
-	asd_printk("AWT Default: 0x%04x\n", DDB_FIELDW(awt_def));
-	asd_printk("compat_features: 0x%02x\n", DDB_FIELDB(compat_features));
-	asd_printk("Pathway Blocked Count: 0x%02x\n",
-		   DDB_FIELDB(pathway_blocked_count));
-	asd_printk("arb_wait_time: 0x%04x\n", DDB_FIELDW(arb_wait_time));
-	asd_printk("more_compat_features: 0x%08x\n",
-		   DDB_FIELDD(more_compat_features));
-	asd_printk("Conn Mask: 0x%02x\n", DDB_FIELDB(conn_mask));
-	asd_printk("flags: 0x%02x\n", DDB_FIELDB(flags));
-	asd_printk("flags2: 0x%02x\n", DDB2_FIELDB(flags2));
-	asd_printk("ExecQ Tail: 0x%04x\n",DDB_FIELDW(exec_queue_tail));
-	asd_printk("SendQ Tail: 0x%04x\n",DDB_FIELDW(send_queue_tail));
-	asd_printk("Active Task Count: 0x%04x\n",
-		   DDB_FIELDW(active_task_count));
-	asd_printk("ITNL Reason: 0x%02x\n", DDB_FIELDB(itnl_reason));
-	asd_printk("ITNL Timeout Const: 0x%04x\n", DDB_FIELDW(itnl_timeout));
-	asd_printk("ITNL timestamp: 0x%08x\n", DDB_FIELDD(itnl_timestamp));
-}
-
-void asd_dump_ddb_0(struct asd_ha_struct *asd_ha)
-{
-#define DDB0_FIELDB(__name)                                  \
-	asd_ddbsite_read_byte(asd_ha, 0,                     \
-			      offsetof(struct asd_ddb_seq_shared, __name))
-#define DDB0_FIELDW(__name)                                  \
-	asd_ddbsite_read_word(asd_ha, 0,                     \
-			      offsetof(struct asd_ddb_seq_shared, __name))
-
-#define DDB0_FIELDD(__name)                                  \
-	asd_ddbsite_read_dword(asd_ha,0 ,                    \
-			       offsetof(struct asd_ddb_seq_shared, __name))
-
-#define DDB0_FIELDA(__name, _o)                              \
-	asd_ddbsite_read_byte(asd_ha, 0,                     \
-			      offsetof(struct asd_ddb_seq_shared, __name)+_o)
-
-
-	asd_printk("DDB: 0\n");
-	asd_printk("q_free_ddb_head:%04x\n", DDB0_FIELDW(q_free_ddb_head));
-	asd_printk("q_free_ddb_tail:%04x\n", DDB0_FIELDW(q_free_ddb_tail));
-	asd_printk("q_free_ddb_cnt:%04x\n",  DDB0_FIELDW(q_free_ddb_cnt));
-	asd_printk("q_used_ddb_head:%04x\n", DDB0_FIELDW(q_used_ddb_head));
-	asd_printk("q_used_ddb_tail:%04x\n", DDB0_FIELDW(q_used_ddb_tail));
-	asd_printk("shared_mem_lock:%04x\n", DDB0_FIELDW(shared_mem_lock));
-	asd_printk("smp_conn_tag:%04x\n",    DDB0_FIELDW(smp_conn_tag));
-	asd_printk("est_nexus_buf_cnt:%04x\n", DDB0_FIELDW(est_nexus_buf_cnt));
-	asd_printk("est_nexus_buf_thresh:%04x\n",
-		   DDB0_FIELDW(est_nexus_buf_thresh));
-	asd_printk("conn_not_active:%02x\n", DDB0_FIELDB(conn_not_active));
-	asd_printk("phy_is_up:%02x\n",       DDB0_FIELDB(phy_is_up));
-	asd_printk("port_map_by_links:%02x %02x %02x %02x "
-		   "%02x %02x %02x %02x\n",
-		   DDB0_FIELDA(port_map_by_links, 0),
-		   DDB0_FIELDA(port_map_by_links, 1),
-		   DDB0_FIELDA(port_map_by_links, 2),
-		   DDB0_FIELDA(port_map_by_links, 3),
-		   DDB0_FIELDA(port_map_by_links, 4),
-		   DDB0_FIELDA(port_map_by_links, 5),
-		   DDB0_FIELDA(port_map_by_links, 6),
-		   DDB0_FIELDA(port_map_by_links, 7));
-}
-
-static void asd_dump_scb_site(struct asd_ha_struct *asd_ha, u16 site_no)
-{
-
-#define SCB_FIELDB(__name)                                                 \
-	asd_scbsite_read_byte(asd_ha, site_no, sizeof(struct scb_header)   \
-			      + offsetof(struct initiate_ssp_task, __name))
-#define SCB_FIELDW(__name)                                                 \
-	asd_scbsite_read_word(asd_ha, site_no, sizeof(struct scb_header)   \
-			      + offsetof(struct initiate_ssp_task, __name))
-#define SCB_FIELDD(__name)                                                 \
-	asd_scbsite_read_dword(asd_ha, site_no, sizeof(struct scb_header)  \
-			       + offsetof(struct initiate_ssp_task, __name))
-
-	asd_printk("Total Xfer Len: 0x%08x.\n", SCB_FIELDD(total_xfer_len));
-	asd_printk("Frame Type: 0x%02x.\n", SCB_FIELDB(ssp_frame.frame_type));
-	asd_printk("Tag: 0x%04x.\n", SCB_FIELDW(ssp_frame.tag));
-	asd_printk("Target Port Xfer Tag: 0x%04x.\n",
-		   SCB_FIELDW(ssp_frame.tptt));
-	asd_printk("Data Offset: 0x%08x.\n", SCB_FIELDW(ssp_frame.data_offs));
-	asd_printk("Retry Count: 0x%02x.\n", SCB_FIELDB(retry_count));
-}
-
-/**
- * asd_dump_scb_sites -- dump currently used CSEQ SCB sites
- * @asd_ha: pointer to host adapter struct
- */
-void asd_dump_scb_sites(struct asd_ha_struct *asd_ha)
-{
-	u16	site_no;
-
-	for (site_no = 0; site_no < asd_ha->hw_prof.max_scbs; site_no++) {
-		u8 opcode;
-
-		if (!SCB_SITE_VALID(site_no))
-			continue;
-
-		/* We are only interested in SCB sites currently used.
-		 */
-		opcode = asd_scbsite_read_byte(asd_ha, site_no,
-					       offsetof(struct scb_header,
-							opcode));
-		if (opcode == 0xFF)
-			continue;
-
-		asd_printk("\nSCB: 0x%x\n", site_no);
-		asd_dump_scb_site(asd_ha, site_no);
-	}
-}
-
-#endif  /*  0  */
-
 /**
  * ads_dump_seq_state -- dump CSEQ and LSEQ states
  * @asd_ha: pointer to host adapter structure
@@ -908,42 +762,4 @@ void asd_dump_frame_rcvd(struct asd_phy *phy,
 	spin_unlock_irqrestore(&phy->sas_phy.frame_rcvd_lock, flags);
 }
 
-#if 0
-
-static void asd_dump_scb(struct asd_ascb *ascb, int ind)
-{
-	asd_printk("scb%d: vaddr: 0x%p, dma_handle: 0x%llx, next: 0x%llx, "
-		   "index:%d, opcode:0x%02x\n",
-		   ind, ascb->dma_scb.vaddr,
-		   (unsigned long long)ascb->dma_scb.dma_handle,
-		   (unsigned long long)
-		   le64_to_cpu(ascb->scb->header.next_scb),
-		   le16_to_cpu(ascb->scb->header.index),
-		   ascb->scb->header.opcode);
-}
-
-void asd_dump_scb_list(struct asd_ascb *ascb, int num)
-{
-	int i = 0;
-
-	asd_printk("dumping %d scbs:\n", num);
-
-	asd_dump_scb(ascb, i++);
-	--num;
-
-	if (num > 0 && !list_empty(&ascb->list)) {
-		struct list_head *el;
-
-		list_for_each(el, &ascb->list) {
-			struct asd_ascb *s = list_entry(el, struct asd_ascb,
-							list);
-			asd_dump_scb(s, i++);
-			if (--num <= 0)
-				break;
-		}
-	}
-}
-
-#endif  /*  0  */
-
 #endif /* ASD_DEBUG */
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 02/18] scsi: mpt3sas: mpt3sas_scs: Move a little data from the stack onto the heap
  2021-03-17  8:56 [PATCH 00/18] [Set 3] Rid W=1 warnings in SCSI Lee Jones
  2021-03-17  8:56 ` [PATCH 01/18] scsi: aic94xx: aic94xx_dump: Remove code that has been unused for at least 13 years Lee Jones
@ 2021-03-17  8:56 ` Lee Jones
  2021-03-17  8:56 ` [PATCH 03/18] scsi: bfa: bfa_fcs_lport: Move a large struct " Lee Jones
                   ` (16 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Lee Jones @ 2021-03-17  8:56 UTC (permalink / raw)
  To: lee.jones
  Cc: linux-kernel, Sathya Prakash, Sreekanth Reddy,
	Suganath Prabu Subramani, James E.J. Bottomley,
	Martin K. Petersen, MPT-FusionLinux.pdl, MPT-FusionLinux.pdl,
	linux-scsi

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

 drivers/scsi/mpt3sas/mpt3sas_scsih.c: In function ‘_scsih_scan_for_devices_after_reset’:
 drivers/scsi/mpt3sas/mpt3sas_scsih.c:10473:1: warning: the frame size of 1064 bytes is larger than 1024 bytes [-Wframe-larger-than=]

Cc: Sathya Prakash <sathya.prakash@broadcom.com>
Cc: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Cc: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: MPT-FusionLinux.pdl@avagotech.com
Cc: MPT-FusionLinux.pdl@broadcom.com
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 38 +++++++++++++++++++---------
 1 file changed, 26 insertions(+), 12 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 7bd0a57e5b928..945531e94d7e4 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -10219,8 +10219,8 @@ _scsih_scan_for_devices_after_reset(struct MPT3SAS_ADAPTER *ioc)
 	Mpi2ExpanderPage0_t expander_pg0;
 	Mpi2SasDevicePage0_t sas_device_pg0;
 	Mpi26PCIeDevicePage0_t pcie_device_pg0;
-	Mpi2RaidVolPage1_t volume_pg1;
-	Mpi2RaidVolPage0_t volume_pg0;
+	Mpi2RaidVolPage1_t *volume_pg1;
+	Mpi2RaidVolPage0_t *volume_pg0;
 	Mpi2RaidPhysDiskPage0_t pd_pg0;
 	Mpi2EventIrConfigElement_t element;
 	Mpi2ConfigReply_t mpi_reply;
@@ -10235,6 +10235,16 @@ _scsih_scan_for_devices_after_reset(struct MPT3SAS_ADAPTER *ioc)
 	u8 retry_count;
 	unsigned long flags;
 
+	volume_pg0 = kzalloc(sizeof(*volume_pg0), GFP_KERNEL);
+	if (!volume_pg0)
+		return;
+
+	volume_pg1 = kzalloc(sizeof(*volume_pg1), GFP_KERNEL);
+	if (!volume_pg1) {
+		kfree(volume_pg0);
+		return;
+	}
+
 	ioc_info(ioc, "scan devices: start\n");
 
 	_scsih_sas_host_refresh(ioc);
@@ -10344,7 +10354,7 @@ _scsih_scan_for_devices_after_reset(struct MPT3SAS_ADAPTER *ioc)
 	/* volumes */
 	handle = 0xFFFF;
 	while (!(mpt3sas_config_get_raid_volume_pg1(ioc, &mpi_reply,
-	    &volume_pg1, MPI2_RAID_VOLUME_PGAD_FORM_GET_NEXT_HANDLE, handle))) {
+	    volume_pg1, MPI2_RAID_VOLUME_PGAD_FORM_GET_NEXT_HANDLE, handle))) {
 		ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
 		    MPI2_IOCSTATUS_MASK;
 		if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
@@ -10352,15 +10362,15 @@ _scsih_scan_for_devices_after_reset(struct MPT3SAS_ADAPTER *ioc)
 				 ioc_status, le32_to_cpu(mpi_reply.IOCLogInfo));
 			break;
 		}
-		handle = le16_to_cpu(volume_pg1.DevHandle);
+		handle = le16_to_cpu(volume_pg1->DevHandle);
 		spin_lock_irqsave(&ioc->raid_device_lock, flags);
 		raid_device = _scsih_raid_device_find_by_wwid(ioc,
-		    le64_to_cpu(volume_pg1.WWID));
+		    le64_to_cpu(volume_pg1->WWID));
 		spin_unlock_irqrestore(&ioc->raid_device_lock, flags);
 		if (raid_device)
 			continue;
 		if (mpt3sas_config_get_raid_volume_pg0(ioc, &mpi_reply,
-		    &volume_pg0, MPI2_RAID_VOLUME_PGAD_FORM_HANDLE, handle,
+		    volume_pg0, MPI2_RAID_VOLUME_PGAD_FORM_HANDLE, handle,
 		     sizeof(Mpi2RaidVolPage0_t)))
 			continue;
 		ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
@@ -10370,17 +10380,17 @@ _scsih_scan_for_devices_after_reset(struct MPT3SAS_ADAPTER *ioc)
 				 ioc_status, le32_to_cpu(mpi_reply.IOCLogInfo));
 			break;
 		}
-		if (volume_pg0.VolumeState == MPI2_RAID_VOL_STATE_OPTIMAL ||
-		    volume_pg0.VolumeState == MPI2_RAID_VOL_STATE_ONLINE ||
-		    volume_pg0.VolumeState == MPI2_RAID_VOL_STATE_DEGRADED) {
+		if (volume_pg0->VolumeState == MPI2_RAID_VOL_STATE_OPTIMAL ||
+		    volume_pg0->VolumeState == MPI2_RAID_VOL_STATE_ONLINE ||
+		    volume_pg0->VolumeState == MPI2_RAID_VOL_STATE_DEGRADED) {
 			memset(&element, 0, sizeof(Mpi2EventIrConfigElement_t));
 			element.ReasonCode = MPI2_EVENT_IR_CHANGE_RC_ADDED;
-			element.VolDevHandle = volume_pg1.DevHandle;
+			element.VolDevHandle = volume_pg1->DevHandle;
 			ioc_info(ioc, "\tBEFORE adding volume: handle (0x%04x)\n",
-				 volume_pg1.DevHandle);
+				 volume_pg1->DevHandle);
 			_scsih_sas_volume_add(ioc, &element);
 			ioc_info(ioc, "\tAFTER adding volume: handle (0x%04x)\n",
-				 volume_pg1.DevHandle);
+				 volume_pg1->DevHandle);
 		}
 	}
 
@@ -10468,6 +10478,10 @@ _scsih_scan_for_devices_after_reset(struct MPT3SAS_ADAPTER *ioc)
 		ioc_info(ioc, "\tAFTER adding pcie end device: handle (0x%04x), wwid(0x%016llx)\n",
 			 handle, (u64)le64_to_cpu(pcie_device_pg0.WWID));
 	}
+
+	kfree(volume_pg0);
+	kfree(volume_pg1);
+
 	ioc_info(ioc, "\tpcie devices: pcie end devices complete\n");
 	ioc_info(ioc, "scan devices: complete\n");
 }
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 03/18] scsi: bfa: bfa_fcs_lport: Move a large struct from the stack onto the heap
  2021-03-17  8:56 [PATCH 00/18] [Set 3] Rid W=1 warnings in SCSI Lee Jones
  2021-03-17  8:56 ` [PATCH 01/18] scsi: aic94xx: aic94xx_dump: Remove code that has been unused for at least 13 years Lee Jones
  2021-03-17  8:56 ` [PATCH 02/18] scsi: mpt3sas: mpt3sas_scs: Move a little data from the stack onto the heap Lee Jones
@ 2021-03-17  8:56 ` Lee Jones
  2021-03-17  8:56 ` [PATCH 04/18] scsi: esas2r: esas2r_log: Supply __printf(x, y) formatting for esas2r_log_master() Lee Jones
                   ` (15 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Lee Jones @ 2021-03-17  8:56 UTC (permalink / raw)
  To: lee.jones
  Cc: linux-kernel, Anil Gurumurthy, Sudarsana Kalluru,
	James E.J. Bottomley, Martin K. Petersen, linux-scsi

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

 drivers/scsi/bfa/bfa_fcs_lport.c: In function ‘bfa_fcs_lport_fdmi_build_rhba_pyld’:
 drivers/scsi/bfa/bfa_fcs_lport.c:2152:1: warning: the frame size of 1200 bytes is larger than 1024 bytes [-Wframe-larger-than=]

Cc: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Cc: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/scsi/bfa/bfa_fcs_lport.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
index 49a14157f123c..b12afcc4b1894 100644
--- a/drivers/scsi/bfa/bfa_fcs_lport.c
+++ b/drivers/scsi/bfa/bfa_fcs_lport.c
@@ -1408,7 +1408,7 @@ static void     bfa_fcs_lport_fdmi_rpa_response(void *fcsarg,
 					       u32 resid_len,
 					       struct fchs_s *rsp_fchs);
 static void     bfa_fcs_lport_fdmi_timeout(void *arg);
-static u16 bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi,
+static int bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi,
 						  u8 *pyld);
 static u16 bfa_fcs_lport_fdmi_build_rprt_pyld(struct bfa_fcs_lport_fdmi_s *fdmi,
 						  u8 *pyld);
@@ -1887,6 +1887,8 @@ bfa_fcs_lport_fdmi_send_rhba(void *fdmi_cbarg, struct bfa_fcxp_s *fcxp_alloced)
 		bfa_fcs_lport_fdmi_build_rhba_pyld(fdmi,
 					  (u8 *) ((struct ct_hdr_s *) pyld
 						       + 1));
+	if (attr_len < 0)
+		return;
 
 	bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE,
 			  FC_CLASS_3, (len + attr_len), &fchs,
@@ -1896,17 +1898,20 @@ bfa_fcs_lport_fdmi_send_rhba(void *fdmi_cbarg, struct bfa_fcxp_s *fcxp_alloced)
 	bfa_sm_send_event(fdmi, FDMISM_EVENT_RHBA_SENT);
 }
 
-static          u16
+static int
 bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi, u8 *pyld)
 {
 	struct bfa_fcs_lport_s *port = fdmi->ms->port;
-	struct bfa_fcs_fdmi_hba_attr_s hba_attr;
-	struct bfa_fcs_fdmi_hba_attr_s *fcs_hba_attr = &hba_attr;
+	struct bfa_fcs_fdmi_hba_attr_s *fcs_hba_attr;
 	struct fdmi_rhba_s *rhba = (struct fdmi_rhba_s *) pyld;
 	struct fdmi_attr_s *attr;
+	int        len;
 	u8        *curr_ptr;
-	u16        len, count;
-	u16	templen;
+	u16	templen, count;
+
+	fcs_hba_attr = kzalloc(sizeof(*fcs_hba_attr), GFP_KERNEL);
+	if (!fcs_hba_attr)
+		return -ENOMEM;
 
 	/*
 	 * get hba attributes
@@ -2148,6 +2153,9 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi, u8 *pyld)
 	len += ((sizeof(attr->type) + sizeof(attr->len)) * count);
 
 	rhba->hba_attr_blk.attr_count = cpu_to_be32(count);
+
+	kfree(fcs_hba_attr);
+
 	return len;
 }
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 04/18] scsi: esas2r: esas2r_log: Supply __printf(x, y) formatting for esas2r_log_master()
  2021-03-17  8:56 [PATCH 00/18] [Set 3] Rid W=1 warnings in SCSI Lee Jones
                   ` (2 preceding siblings ...)
  2021-03-17  8:56 ` [PATCH 03/18] scsi: bfa: bfa_fcs_lport: Move a large struct " Lee Jones
@ 2021-03-17  8:56 ` Lee Jones
  2021-03-17  8:56 ` [PATCH 05/18] scsi: BusLogic: Supply __printf(x, y) formatting for blogic_msg() Lee Jones
                   ` (14 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Lee Jones @ 2021-03-17  8:56 UTC (permalink / raw)
  To: lee.jones
  Cc: linux-kernel, Bradley Grove, James E.J. Bottomley,
	Martin K. Petersen, linux-scsi

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

 drivers/scsi/esas2r/esas2r_log.c: In function ‘esas2r_log_master’:
 drivers/scsi/esas2r/esas2r_log.c:155:3: warning: function ‘esas2r_log_master’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]

Cc: Bradley Grove <linuxdrivers@attotech.com>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/scsi/esas2r/esas2r_log.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/scsi/esas2r/esas2r_log.c b/drivers/scsi/esas2r/esas2r_log.c
index b545798e400c4..d6c87a0bae098 100644
--- a/drivers/scsi/esas2r/esas2r_log.c
+++ b/drivers/scsi/esas2r/esas2r_log.c
@@ -101,6 +101,11 @@ static const char *translate_esas2r_event_level_to_kernel(const long level)
 	}
 }
 
+#pragma GCC diagnostic push
+#ifndef __clang__
+#pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
+#endif
+
 /*
  * the master logging function.  this function will format the message as
  * outlined by the formatting string, the input device information and the
@@ -170,6 +175,8 @@ static int esas2r_log_master(const long level,
 	return 0;
 }
 
+#pragma GCC diagnostic pop
+
 /*
  * formats and logs a message to the system log.
  *
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 05/18] scsi: BusLogic: Supply __printf(x, y) formatting for blogic_msg()
  2021-03-17  8:56 [PATCH 00/18] [Set 3] Rid W=1 warnings in SCSI Lee Jones
                   ` (3 preceding siblings ...)
  2021-03-17  8:56 ` [PATCH 04/18] scsi: esas2r: esas2r_log: Supply __printf(x, y) formatting for esas2r_log_master() Lee Jones
@ 2021-03-17  8:56 ` Lee Jones
  2021-03-17  8:56 ` [PATCH 06/18] scsi: nsp32: Supply __printf(x, y) formatting for nsp32_message() Lee Jones
                   ` (13 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Lee Jones @ 2021-03-17  8:56 UTC (permalink / raw)
  To: lee.jones
  Cc: linux-kernel, Khalid Aziz, James E.J. Bottomley,
	Martin K. Petersen, Leonard N. Zubkoff, linux-scsi

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

 In file included from drivers/scsi/BusLogic.c:51:
 drivers/scsi/BusLogic.c: In function ‘blogic_msg’:
 drivers/scsi/BusLogic.c:3591:2: warning: function ‘blogic_msg’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]

Cc: Khalid Aziz <khalid@gonehiking.org>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: "Leonard N. Zubkoff" <lnz@dandelion.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/scsi/BusLogic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
index ccb061ab0a0ad..0ac3f713fc212 100644
--- a/drivers/scsi/BusLogic.c
+++ b/drivers/scsi/BusLogic.c
@@ -3578,7 +3578,7 @@ Target	Requested Completed  Requested Completed  Requested Completed\n\
 /*
   blogic_msg prints Driver Messages.
 */
-
+__printf(2, 4)
 static void blogic_msg(enum blogic_msglevel msglevel, char *fmt,
 			struct blogic_adapter *adapter, ...)
 {
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 06/18] scsi: nsp32: Supply __printf(x, y) formatting for nsp32_message()
  2021-03-17  8:56 [PATCH 00/18] [Set 3] Rid W=1 warnings in SCSI Lee Jones
                   ` (4 preceding siblings ...)
  2021-03-17  8:56 ` [PATCH 05/18] scsi: BusLogic: Supply __printf(x, y) formatting for blogic_msg() Lee Jones
@ 2021-03-17  8:56 ` Lee Jones
  2021-03-17  8:56 ` [PATCH 07/18] scsi: initio: Remove unused variable 'prev' Lee Jones
                   ` (12 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Lee Jones @ 2021-03-17  8:56 UTC (permalink / raw)
  To: lee.jones
  Cc: linux-kernel, GOTO Masanori, YOKOTA Hiroshi,
	James E.J. Bottomley, Martin K. Petersen, gotom, linux-scsi

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

 drivers/scsi/nsp32.c: In function ‘nsp32_message’:
 drivers/scsi/nsp32.c:318:2: warning: function ‘nsp32_message’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]

Cc: GOTO Masanori <gotom@debian.or.jp>
Cc: YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: gotom@debian.org
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/scsi/nsp32.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c
index e44b1a0f67099..d5aa96f05bce4 100644
--- a/drivers/scsi/nsp32.c
+++ b/drivers/scsi/nsp32.c
@@ -309,6 +309,7 @@ static struct scsi_host_template nsp32_template = {
 
 #define NSP32_DEBUG_BUF_LEN		100
 
+__printf(4, 5)
 static void nsp32_message(const char *func, int line, char *type, char *fmt, ...)
 {
 	va_list args;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 07/18] scsi: initio: Remove unused variable 'prev'
  2021-03-17  8:56 [PATCH 00/18] [Set 3] Rid W=1 warnings in SCSI Lee Jones
                   ` (5 preceding siblings ...)
  2021-03-17  8:56 ` [PATCH 06/18] scsi: nsp32: Supply __printf(x, y) formatting for nsp32_message() Lee Jones
@ 2021-03-17  8:56 ` Lee Jones
  2021-03-17  8:56 ` [PATCH 08/18] scsi: a100u2w: Remove unused variable 'bios_phys' Lee Jones
                   ` (11 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Lee Jones @ 2021-03-17  8:56 UTC (permalink / raw)
  To: lee.jones
  Cc: linux-kernel, James E.J. Bottomley, Martin K. Petersen,
	Bas Vermeulen, Christoph Hellwig, Brian Macy, linux-scsi

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

 drivers/scsi/initio.c: In function ‘initio_find_busy_scb’:
 drivers/scsi/initio.c:869:30: warning: variable ‘prev’ set but not used [-Wunused-but-set-variable]

Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Bas Vermeulen <bvermeul@blackstar.xs4all.nl>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Brian Macy <bmacy@sunshinecomputing.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/scsi/initio.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c
index 814acc57069dc..926a7045c2e5c 100644
--- a/drivers/scsi/initio.c
+++ b/drivers/scsi/initio.c
@@ -866,17 +866,16 @@ static void initio_unlink_busy_scb(struct initio_host * host, struct scsi_ctrl_b
 
 struct scsi_ctrl_blk *initio_find_busy_scb(struct initio_host * host, u16 tarlun)
 {
-	struct scsi_ctrl_blk *tmp, *prev;
+	struct scsi_ctrl_blk *tmp;
 	u16 scbp_tarlun;
 
 
-	prev = tmp = host->first_busy;
+	tmp = host->first_busy;
 	while (tmp != NULL) {
 		scbp_tarlun = (tmp->lun << 8) | (tmp->target);
 		if (scbp_tarlun == tarlun) {	/* Unlink this SCB              */
 			break;
 		}
-		prev = tmp;
 		tmp = tmp->next;
 	}
 #if DEBUG_QUEUE
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 08/18] scsi: a100u2w: Remove unused variable 'bios_phys'
  2021-03-17  8:56 [PATCH 00/18] [Set 3] Rid W=1 warnings in SCSI Lee Jones
                   ` (6 preceding siblings ...)
  2021-03-17  8:56 ` [PATCH 07/18] scsi: initio: Remove unused variable 'prev' Lee Jones
@ 2021-03-17  8:56 ` Lee Jones
  2021-03-17  8:56 ` [PATCH 09/18] scsi: myrs: Remove a couple of unused 'status' variables Lee Jones
                   ` (10 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Lee Jones @ 2021-03-17  8:56 UTC (permalink / raw)
  To: lee.jones
  Cc: linux-kernel, James E.J. Bottomley, Martin K. Petersen,
	Doug Ledford, Christoph Hellwig, Alan Cox, linux-scsi

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

 drivers/scsi/a100u2w.c: In function ‘inia100_probe_one’:
 drivers/scsi/a100u2w.c:1092:8: warning: variable ‘bios_phys’ set but not used [-Wunused-but-set-variable]

Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Doug Ledford <dledford@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/scsi/a100u2w.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/scsi/a100u2w.c b/drivers/scsi/a100u2w.c
index 66c514310f3c5..c99224a128f82 100644
--- a/drivers/scsi/a100u2w.c
+++ b/drivers/scsi/a100u2w.c
@@ -1089,7 +1089,6 @@ static int inia100_probe_one(struct pci_dev *pdev,
 	int error = -ENODEV;
 	u32 sz;
 	unsigned long biosaddr;
-	char *bios_phys;
 
 	if (pci_enable_device(pdev))
 		goto out;
@@ -1141,7 +1140,6 @@ static int inia100_probe_one(struct pci_dev *pdev,
 
 	biosaddr = host->BIOScfg;
 	biosaddr = (biosaddr << 4);
-	bios_phys = phys_to_virt(biosaddr);
 	if (init_orchid(host)) {	/* Initialize orchid chip */
 		printk("inia100: initial orchid fail!!\n");
 		goto out_free_escb_array;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 09/18] scsi: myrs: Remove a couple of unused 'status' variables
  2021-03-17  8:56 [PATCH 00/18] [Set 3] Rid W=1 warnings in SCSI Lee Jones
                   ` (7 preceding siblings ...)
  2021-03-17  8:56 ` [PATCH 08/18] scsi: a100u2w: Remove unused variable 'bios_phys' Lee Jones
@ 2021-03-17  8:56 ` Lee Jones
  2021-03-17  8:56 ` [PATCH 10/18] scsi: 3w-xxxx: Remove 2 unused variables 'response_que_value' and 'tw_dev' Lee Jones
                   ` (9 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Lee Jones @ 2021-03-17  8:56 UTC (permalink / raw)
  To: lee.jones
  Cc: linux-kernel, Hannes Reinecke, James E.J. Bottomley,
	Martin K. Petersen, Linux GmbH, Leonard N. Zubkoff, linux-scsi

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

 drivers/scsi/myrs.c: In function ‘consistency_check_show’:
 drivers/scsi/myrs.c:1193:16: warning: variable ‘status’ set but not used [-Wunused-but-set-variable]
 drivers/scsi/myrs.c: In function ‘myrs_get_resync’:
 drivers/scsi/myrs.c:1984:5: warning: variable ‘status’ set but not used [-Wunused-but-set-variable]

Cc: Hannes Reinecke <hare@kernel.org>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Linux GmbH <hare@suse.com>
Cc: "Leonard N. Zubkoff" <lnz@dandelion.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/scsi/myrs.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/myrs.c b/drivers/scsi/myrs.c
index 4adf9ded296aa..48e399f057d5c 100644
--- a/drivers/scsi/myrs.c
+++ b/drivers/scsi/myrs.c
@@ -1190,7 +1190,6 @@ static ssize_t consistency_check_show(struct device *dev,
 	struct myrs_hba *cs = shost_priv(sdev->host);
 	struct myrs_ldev_info *ldev_info;
 	unsigned short ldev_num;
-	unsigned char status;
 
 	if (sdev->channel < cs->ctlr_info->physchan_present)
 		return snprintf(buf, 32, "physical device - not checking\n");
@@ -1199,7 +1198,7 @@ static ssize_t consistency_check_show(struct device *dev,
 	if (!ldev_info)
 		return -ENXIO;
 	ldev_num = ldev_info->ldev_num;
-	status = myrs_get_ldev_info(cs, ldev_num, ldev_info);
+	myrs_get_ldev_info(cs, ldev_num, ldev_info);
 	if (ldev_info->cc_active)
 		return snprintf(buf, 32, "checking block %zu of %zu\n",
 				(size_t)ldev_info->cc_lba,
@@ -1981,14 +1980,13 @@ myrs_get_resync(struct device *dev)
 	struct myrs_hba *cs = shost_priv(sdev->host);
 	struct myrs_ldev_info *ldev_info = sdev->hostdata;
 	u64 percent_complete = 0;
-	u8 status;
 
 	if (sdev->channel < cs->ctlr_info->physchan_present || !ldev_info)
 		return;
 	if (ldev_info->rbld_active) {
 		unsigned short ldev_num = ldev_info->ldev_num;
 
-		status = myrs_get_ldev_info(cs, ldev_num, ldev_info);
+		myrs_get_ldev_info(cs, ldev_num, ldev_info);
 		percent_complete = ldev_info->rbld_lba * 100;
 		do_div(percent_complete, ldev_info->cfg_devsize);
 	}
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 10/18] scsi: 3w-xxxx: Remove 2 unused variables 'response_que_value' and 'tw_dev'
  2021-03-17  8:56 [PATCH 00/18] [Set 3] Rid W=1 warnings in SCSI Lee Jones
                   ` (8 preceding siblings ...)
  2021-03-17  8:56 ` [PATCH 09/18] scsi: myrs: Remove a couple of unused 'status' variables Lee Jones
@ 2021-03-17  8:56 ` Lee Jones
  2021-03-17  8:56 ` [PATCH 11/18] scsi: 3w-9xxx: Remove a few set but unused variables Lee Jones
                   ` (8 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Lee Jones @ 2021-03-17  8:56 UTC (permalink / raw)
  To: lee.jones
  Cc: linux-kernel, Adam Radford, James E.J. Bottomley,
	Martin K. Petersen, Joel Jacobson, de Melo, Andre Hedrick,
	linux-scsi

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

 drivers/scsi/3w-xxxx.c: In function ‘tw_empty_response_que’:
 drivers/scsi/3w-xxxx.c:463:24: warning: variable ‘response_que_value’ set but not used [-Wunused-but-set-variable]
 drivers/scsi/3w-xxxx.c: In function ‘tw_scsi_biosparam’:
 drivers/scsi/3w-xxxx.c:1345:23: warning: variable ‘tw_dev’ set but not used [-Wunused-but-set-variable]

Cc: Adam Radford <aradford@gmail.com>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Joel Jacobson <linux@3ware.com>
Cc: de Melo <acme@conectiva.com.br>
Cc: Andre Hedrick <andre@suse.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/scsi/3w-xxxx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c
index d90b9fca4aea2..a7292883b72bc 100644
--- a/drivers/scsi/3w-xxxx.c
+++ b/drivers/scsi/3w-xxxx.c
@@ -460,12 +460,12 @@ static int tw_check_errors(TW_Device_Extension *tw_dev)
 /* This function will empty the response que */
 static void tw_empty_response_que(TW_Device_Extension *tw_dev)
 {
-	u32 status_reg_value, response_que_value;
+	u32 status_reg_value;
 
 	status_reg_value = inl(TW_STATUS_REG_ADDR(tw_dev));
 
 	while ((status_reg_value & TW_STATUS_RESPONSE_QUEUE_EMPTY) == 0) {
-		response_que_value = inl(TW_RESPONSE_QUEUE_REG_ADDR(tw_dev));
+		inl(TW_RESPONSE_QUEUE_REG_ADDR(tw_dev));
 		status_reg_value = inl(TW_STATUS_REG_ADDR(tw_dev));
 	}
 } /* End tw_empty_response_que() */
@@ -1342,10 +1342,8 @@ static int tw_scsi_biosparam(struct scsi_device *sdev, struct block_device *bdev
 			     sector_t capacity, int geom[])
 {
 	int heads, sectors, cylinders;
-	TW_Device_Extension *tw_dev;
 
 	dprintk(KERN_NOTICE "3w-xxxx: tw_scsi_biosparam()\n");
-	tw_dev = (TW_Device_Extension *)sdev->host->hostdata;
 
 	heads = 64;
 	sectors = 32;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 11/18] scsi: 3w-9xxx: Remove a few set but unused variables
  2021-03-17  8:56 [PATCH 00/18] [Set 3] Rid W=1 warnings in SCSI Lee Jones
                   ` (9 preceding siblings ...)
  2021-03-17  8:56 ` [PATCH 10/18] scsi: 3w-xxxx: Remove 2 unused variables 'response_que_value' and 'tw_dev' Lee Jones
@ 2021-03-17  8:56 ` Lee Jones
  2021-03-17  8:56 ` [PATCH 12/18] scsi: 3w-sas: Remove unused variables 'sglist' and 'tw_dev' Lee Jones
                   ` (7 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Lee Jones @ 2021-03-17  8:56 UTC (permalink / raw)
  To: lee.jones
  Cc: linux-kernel, Adam Radford, James E.J. Bottomley,
	Martin K. Petersen, linux-scsi

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

 drivers/scsi/3w-9xxx.c: In function ‘twa_empty_response_queue’:
 drivers/scsi/3w-9xxx.c:942:24: warning: variable ‘response_que_value’ set but not used [-Wunused-but-set-variable]
 drivers/scsi/3w-9xxx.c: In function ‘twa_scsi_biosparam’:
 drivers/scsi/3w-9xxx.c:1701:23: warning: variable ‘tw_dev’ set but not used [-Wunused-but-set-variable]
 drivers/scsi/3w-9xxx.c: In function ‘twa_scsiop_execute_scsi’:
 drivers/scsi/3w-9xxx.c:1812:22: warning: variable ‘sglist’ set but not used [-Wunused-but-set-variable]

Cc: Adam Radford <aradford@gmail.com>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/scsi/3w-9xxx.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
index b96e82de4237d..47028f5e57abd 100644
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -939,13 +939,13 @@ static int twa_decode_bits(TW_Device_Extension *tw_dev, u32 status_reg_value)
 /* This function will empty the response queue */
 static int twa_empty_response_queue(TW_Device_Extension *tw_dev)
 {
-	u32 status_reg_value, response_que_value;
+	u32 status_reg_value;
 	int count = 0, retval = 1;
 
 	status_reg_value = readl(TW_STATUS_REG_ADDR(tw_dev));
 
 	while (((status_reg_value & TW_STATUS_RESPONSE_QUEUE_EMPTY) == 0) && (count < TW_MAX_RESPONSE_DRAIN)) {
-		response_que_value = readl(TW_RESPONSE_QUEUE_REG_ADDR(tw_dev));
+		readl(TW_RESPONSE_QUEUE_REG_ADDR(tw_dev));
 		status_reg_value = readl(TW_STATUS_REG_ADDR(tw_dev));
 		count++;
 	}
@@ -1698,9 +1698,6 @@ static int twa_reset_sequence(TW_Device_Extension *tw_dev, int soft_reset)
 static int twa_scsi_biosparam(struct scsi_device *sdev, struct block_device *bdev, sector_t capacity, int geom[])
 {
 	int heads, sectors, cylinders;
-	TW_Device_Extension *tw_dev;
-
-	tw_dev = (TW_Device_Extension *)sdev->host->hostdata;
 
 	if (capacity >= 0x200000) {
 		heads = 255;
@@ -1809,14 +1806,11 @@ static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id,
 	u32 num_sectors = 0x0;
 	int i, sg_count;
 	struct scsi_cmnd *srb = NULL;
-	struct scatterlist *sglist = NULL, *sg;
+	struct scatterlist *sg;
 	int retval = 1;
 
-	if (tw_dev->srb[request_id]) {
+	if (tw_dev->srb[request_id])
 		srb = tw_dev->srb[request_id];
-		if (scsi_sglist(srb))
-			sglist = scsi_sglist(srb);
-	}
 
 	/* Initialize command packet */
 	full_command_packet = tw_dev->command_packet_virt[request_id];
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 12/18] scsi: 3w-sas: Remove unused variables 'sglist' and 'tw_dev'
  2021-03-17  8:56 [PATCH 00/18] [Set 3] Rid W=1 warnings in SCSI Lee Jones
                   ` (10 preceding siblings ...)
  2021-03-17  8:56 ` [PATCH 11/18] scsi: 3w-9xxx: Remove a few set but unused variables Lee Jones
@ 2021-03-17  8:56 ` Lee Jones
  2021-03-17  8:56 ` [PATCH 13/18] scsi: nsp32: Remove or exclude unused variables Lee Jones
                   ` (6 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Lee Jones @ 2021-03-17  8:56 UTC (permalink / raw)
  To: lee.jones
  Cc: linux-kernel, Adam Radford, James E.J. Bottomley,
	Martin K. Petersen, linux-scsi

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

 drivers/scsi/3w-sas.c: In function ‘twl_scsiop_execute_scsi’:
 drivers/scsi/3w-sas.c:298:22: warning: variable ‘sglist’ set but not used [-Wunused-but-set-variable]
 drivers/scsi/3w-sas.c: In function ‘twl_scsi_biosparam’:
 drivers/scsi/3w-sas.c:1411:23: warning: variable ‘tw_dev’ set but not used [-Wunused-but-set-variable]

Cc: Adam Radford <aradford@gmail.com>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/scsi/3w-sas.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c
index 3db0e42e9aa75..383f6f204c24b 100644
--- a/drivers/scsi/3w-sas.c
+++ b/drivers/scsi/3w-sas.c
@@ -295,14 +295,11 @@ static int twl_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id,
 	TW_Command_Apache *command_packet;
 	int i, sg_count;
 	struct scsi_cmnd *srb = NULL;
-	struct scatterlist *sglist = NULL, *sg;
+	struct scatterlist *sg;
 	int retval = 1;
 
-	if (tw_dev->srb[request_id]) {
+	if (tw_dev->srb[request_id])
 		srb = tw_dev->srb[request_id];
-		if (scsi_sglist(srb))
-			sglist = scsi_sglist(srb);
-	}
 
 	/* Initialize command packet */
 	full_command_packet = tw_dev->command_packet_virt[request_id];
@@ -1408,9 +1405,6 @@ static int twl_reset_device_extension(TW_Device_Extension *tw_dev, int ioctl_res
 static int twl_scsi_biosparam(struct scsi_device *sdev, struct block_device *bdev, sector_t capacity, int geom[])
 {
 	int heads, sectors;
-	TW_Device_Extension *tw_dev;
-
-	tw_dev = (TW_Device_Extension *)sdev->host->hostdata;
 
 	if (capacity >= 0x200000) {
 		heads = 255;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 13/18] scsi: nsp32: Remove or exclude unused variables
  2021-03-17  8:56 [PATCH 00/18] [Set 3] Rid W=1 warnings in SCSI Lee Jones
                   ` (11 preceding siblings ...)
  2021-03-17  8:56 ` [PATCH 12/18] scsi: 3w-sas: Remove unused variables 'sglist' and 'tw_dev' Lee Jones
@ 2021-03-17  8:56 ` Lee Jones
  2021-03-17  8:56 ` [PATCH 14/18] scsi: FlashPoint: Remove unused variable 'TID' from 'FlashPoint_AbortCCB()' Lee Jones
                   ` (5 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Lee Jones @ 2021-03-17  8:56 UTC (permalink / raw)
  To: lee.jones
  Cc: linux-kernel, GOTO Masanori, YOKOTA Hiroshi,
	James E.J. Bottomley, Martin K. Petersen, gotom, linux-scsi

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

 drivers/scsi/nsp32.c: In function ‘nsp32_selection_autoscsi’:
 drivers/scsi/nsp32.c:584:17: warning: variable ‘execph’ set but not used [-Wunused-but-set-variable]
 drivers/scsi/nsp32.c: In function ‘nsp32_msgout_occur’:
 drivers/scsi/nsp32.c:1785:7: warning: variable ‘new_sgtp’ set but not used [-Wunused-but-set-variable]
 drivers/scsi/nsp32.c: In function ‘nsp32_analyze_sdtr’:
 drivers/scsi/nsp32.c:2227:20: warning: variable ‘syncnum’ set but not used [-Wunused-but-set-variable]
 drivers/scsi/nsp32.c:2223:20: warning: variable ‘synct’ set but not used [-Wunused-but-set-variable]
 drivers/scsi/nsp32.c: In function ‘nsp32_do_bus_reset’:
 drivers/scsi/nsp32.c:2841:17: warning: variable ‘intrdat’ set but not used [-Wunused-but-set-variable]
 drivers/scsi/nsp32.c: In function ‘nsp32_getprom_param’:
 drivers/scsi/nsp32.c:2912:11: warning: variable ‘val’ set but not used [-Wunused-but-set-variable]

Cc: GOTO Masanori <gotom@debian.or.jp>
Cc: YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: gotom@debian.org
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/scsi/nsp32.c | 23 ++++-------------------
 1 file changed, 4 insertions(+), 19 deletions(-)

diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c
index d5aa96f05bce4..54abda4d07c64 100644
--- a/drivers/scsi/nsp32.c
+++ b/drivers/scsi/nsp32.c
@@ -581,7 +581,6 @@ static int nsp32_selection_autoscsi(struct scsi_cmnd *SCpnt)
 	int		status;
 	unsigned short	command	= 0;
 	unsigned int	msgout  = 0;
-	unsigned short	execph;
 	int		i;
 
 	nsp32_dbg(NSP32_DEBUG_AUTOSCSI, "in");
@@ -605,7 +604,7 @@ static int nsp32_selection_autoscsi(struct scsi_cmnd *SCpnt)
 	/*
 	 * clear execph
 	 */
-	execph = nsp32_read2(base, SCSI_EXECUTE_PHASE);
+	nsp32_read2(base, SCSI_EXECUTE_PHASE);
 
 	/*
 	 * clear FIFO counter to set CDBs
@@ -1781,8 +1780,6 @@ static void nsp32_msgout_occur(struct scsi_cmnd *SCpnt)
 {
 	nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata;
 	unsigned int base   = SCpnt->device->host->io_port;
-	//unsigned short command;
-	long new_sgtp;
 	int i;
 	
 	nsp32_dbg(NSP32_DEBUG_MSGOUTOCCUR,
@@ -1796,14 +1793,6 @@ static void nsp32_msgout_occur(struct scsi_cmnd *SCpnt)
 		nsp32_build_nop(SCpnt);
 	}
 
-	/*
-	 * Set SGTP ADDR current entry for restarting AUTOSCSI, 
-	 * because SGTP is incremented next point.
-	 * There is few statement in the specification...
-	 */
- 	new_sgtp = data->cur_lunt->sglun_paddr + 
-		   (data->cur_lunt->cur_entry * sizeof(nsp32_sgtable));
-
 	/*
 	 * send messages
 	 */
@@ -2220,17 +2209,12 @@ static void nsp32_analyze_sdtr(struct scsi_cmnd *SCpnt)
 {
 	nsp32_hw_data   *data = (nsp32_hw_data *)SCpnt->device->host->hostdata;
 	nsp32_target     *target     = data->cur_target;
-	nsp32_sync_table *synct;
 	unsigned char     get_period = data->msginbuf[3];
 	unsigned char     get_offset = data->msginbuf[4];
 	int               entry;
-	int               syncnum;
 
 	nsp32_dbg(NSP32_DEBUG_MSGINOCCUR, "enter");
 
-	synct   = data->synct;
-	syncnum = data->syncnum;
-
 	/*
 	 * If this inititor sent the SDTR message, then target responds SDTR,
 	 * initiator SYNCREG, ACKWIDTH from SDTR parameter.
@@ -2838,8 +2822,8 @@ static int nsp32_eh_abort(struct scsi_cmnd *SCpnt)
 static void nsp32_do_bus_reset(nsp32_hw_data *data)
 {
 	unsigned int   base = data->BaseAddress;
-	unsigned short intrdat;
 	int i;
+	unsigned short __maybe_unused intrdat;
 
 	nsp32_dbg(NSP32_DEBUG_BUSRESET, "in");
 
@@ -2909,7 +2893,8 @@ static int nsp32_getprom_param(nsp32_hw_data *data)
 {
 	int vendor = data->pci_devid->vendor;
 	int device = data->pci_devid->device;
-	int ret, val, i;
+	int ret, i;
+	int __maybe_unused val;
 
 	/*
 	 * EEPROM checking.
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 14/18] scsi: FlashPoint: Remove unused variable 'TID' from 'FlashPoint_AbortCCB()'
  2021-03-17  8:56 [PATCH 00/18] [Set 3] Rid W=1 warnings in SCSI Lee Jones
                   ` (12 preceding siblings ...)
  2021-03-17  8:56 ` [PATCH 13/18] scsi: nsp32: Remove or exclude unused variables Lee Jones
@ 2021-03-17  8:56 ` Lee Jones
  2021-03-17  8:56 ` [PATCH 15/18] scsi: sim710: Remove unused variable 'err' from sim710_init() Lee Jones
                   ` (4 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Lee Jones @ 2021-03-17  8:56 UTC (permalink / raw)
  To: lee.jones
  Cc: linux-kernel, Khalid Aziz, James E.J. Bottomley,
	Martin K. Petersen, linux-scsi

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

 drivers/scsi/FlashPoint.c: In function ‘FlashPoint_AbortCCB’:
 drivers/scsi/FlashPoint.c:1618:16: warning: variable ‘TID’ set but not used [-Wunused-but-set-variable]

Cc: Khalid Aziz <khalid@gonehiking.org>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/scsi/FlashPoint.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/scsi/FlashPoint.c b/drivers/scsi/FlashPoint.c
index f479c542e787c..0464e37c806a4 100644
--- a/drivers/scsi/FlashPoint.c
+++ b/drivers/scsi/FlashPoint.c
@@ -1615,7 +1615,6 @@ static int FlashPoint_AbortCCB(void *pCurrCard, struct sccb *p_Sccb)
 
 	unsigned char thisCard;
 	CALL_BK_FN callback;
-	unsigned char TID;
 	struct sccb *pSaveSCCB;
 	struct sccb_mgr_tar_info *currTar_Info;
 
@@ -1652,9 +1651,6 @@ static int FlashPoint_AbortCCB(void *pCurrCard, struct sccb *p_Sccb)
 			}
 
 			else {
-
-				TID = p_Sccb->TargID;
-
 				if (p_Sccb->Sccb_tag) {
 					MDISABLE_INT(ioport);
 					if (((struct sccb_card *)pCurrCard)->
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 15/18] scsi: sim710: Remove unused variable 'err' from sim710_init()
  2021-03-17  8:56 [PATCH 00/18] [Set 3] Rid W=1 warnings in SCSI Lee Jones
                   ` (13 preceding siblings ...)
  2021-03-17  8:56 ` [PATCH 14/18] scsi: FlashPoint: Remove unused variable 'TID' from 'FlashPoint_AbortCCB()' Lee Jones
@ 2021-03-17  8:56 ` Lee Jones
  2021-03-17  8:56 ` [PATCH 16/18] scsi: isci: port: Make local function 'port_state_name()' static Lee Jones
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Lee Jones @ 2021-03-17  8:56 UTC (permalink / raw)
  To: lee.jones
  Cc: linux-kernel, James E.J. Bottomley, Martin K. Petersen,
	Richard Hirst, c by, linux-scsi

Take the opportunity to rework the comment a little.

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

 drivers/scsi/sim710.c: In function ‘sim710_init’:
 drivers/scsi/sim710.c:216:6: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]

Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Richard Hirst <richard@sleepie.demon.co.uk>
Cc: c by <James.Bottomley@SteelEye.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/scsi/sim710.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/sim710.c b/drivers/scsi/sim710.c
index 22302612e032b..e519df68d603d 100644
--- a/drivers/scsi/sim710.c
+++ b/drivers/scsi/sim710.c
@@ -213,21 +213,19 @@ static struct eisa_driver sim710_eisa_driver = {
 
 static int __init sim710_init(void)
 {
-	int err = -ENODEV;
-
 #ifdef MODULE
 	if (sim710)
 		param_setup(sim710);
 #endif
 
 #ifdef CONFIG_EISA
-	err = eisa_driver_register(&sim710_eisa_driver);
+	/*
+	 * FIXME: We'd really like to return -ENODEV if no devices have actually
+	 * been found.  However eisa_driver_register() only reports problems
+	 * with kobject_register() so simply return success for now.
+	 */
+	eisa_driver_register(&sim710_eisa_driver);
 #endif
-	/* FIXME: what we'd really like to return here is -ENODEV if
-	 * no devices have actually been found.  Instead, the err
-	 * above actually only reports problems with kobject_register,
-	 * so for the moment return success */
-
 	return 0;
 }
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 16/18] scsi: isci: port: Make local function 'port_state_name()' static
  2021-03-17  8:56 [PATCH 00/18] [Set 3] Rid W=1 warnings in SCSI Lee Jones
                   ` (14 preceding siblings ...)
  2021-03-17  8:56 ` [PATCH 15/18] scsi: sim710: Remove unused variable 'err' from sim710_init() Lee Jones
@ 2021-03-17  8:56 ` Lee Jones
  2021-03-17  8:57 ` [PATCH 17/18] scsi: isci: remote_device: Make local function isci_remote_device_wait_for_resume_from_abort() static Lee Jones
                   ` (2 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Lee Jones @ 2021-03-17  8:56 UTC (permalink / raw)
  To: lee.jones
  Cc: linux-kernel, Artur Paszkiewicz, James E.J. Bottomley,
	Martin K. Petersen, linux-scsi

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

 drivers/scsi/isci/port.c:65:13: warning: no previous prototype for ‘port_state_name’ [-Wmissing-prototypes]

Cc: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/scsi/isci/port.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/isci/port.c b/drivers/scsi/isci/port.c
index 448a8c31ba359..5a362ba76d63f 100644
--- a/drivers/scsi/isci/port.c
+++ b/drivers/scsi/isci/port.c
@@ -62,7 +62,7 @@
 
 #undef C
 #define C(a) (#a)
-const char *port_state_name(enum sci_port_states state)
+static const char *port_state_name(enum sci_port_states state)
 {
 	static const char * const strings[] = PORT_STATES;
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 17/18] scsi: isci: remote_device: Make local function isci_remote_device_wait_for_resume_from_abort() static
  2021-03-17  8:56 [PATCH 00/18] [Set 3] Rid W=1 warnings in SCSI Lee Jones
                   ` (15 preceding siblings ...)
  2021-03-17  8:56 ` [PATCH 16/18] scsi: isci: port: Make local function 'port_state_name()' static Lee Jones
@ 2021-03-17  8:57 ` Lee Jones
  2021-03-17  8:57 ` [PATCH 18/18] scsi: nsp32: Correct expected types in debug print formatting Lee Jones
  2021-03-17  9:05 ` [PATCH 00/18] [Set 3] Rid W=1 warnings in SCSI Lee Jones
  18 siblings, 0 replies; 20+ messages in thread
From: Lee Jones @ 2021-03-17  8:57 UTC (permalink / raw)
  To: lee.jones
  Cc: linux-kernel, Artur Paszkiewicz, James E.J. Bottomley,
	Martin K. Petersen, linux-scsi

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

 drivers/scsi/isci/remote_device.c:1387:6: warning: no previous prototype for ‘isci_remote_device_wait_for_resume_from_abort’ [-Wmissing-prototypes]

Cc: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/scsi/isci/remote_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/isci/remote_device.c b/drivers/scsi/isci/remote_device.c
index c3f540b556895..b1276f7e49c89 100644
--- a/drivers/scsi/isci/remote_device.c
+++ b/drivers/scsi/isci/remote_device.c
@@ -1384,7 +1384,7 @@ static bool isci_remote_device_test_resume_done(
 	return done;
 }
 
-void isci_remote_device_wait_for_resume_from_abort(
+static void isci_remote_device_wait_for_resume_from_abort(
 	struct isci_host *ihost,
 	struct isci_remote_device *idev)
 {
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 18/18] scsi: nsp32: Correct expected types in debug print formatting
  2021-03-17  8:56 [PATCH 00/18] [Set 3] Rid W=1 warnings in SCSI Lee Jones
                   ` (16 preceding siblings ...)
  2021-03-17  8:57 ` [PATCH 17/18] scsi: isci: remote_device: Make local function isci_remote_device_wait_for_resume_from_abort() static Lee Jones
@ 2021-03-17  8:57 ` Lee Jones
  2021-03-17  9:05 ` [PATCH 00/18] [Set 3] Rid W=1 warnings in SCSI Lee Jones
  18 siblings, 0 replies; 20+ messages in thread
From: Lee Jones @ 2021-03-17  8:57 UTC (permalink / raw)
  To: lee.jones
  Cc: linux-kernel, GOTO Masanori, YOKOTA Hiroshi,
	James E.J. Bottomley, Martin K. Petersen, gotom, linux-scsi

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

 drivers/scsi/nsp32.c: In function ‘nsp32_setup_sg_table’:
 drivers/scsi/nsp32.c:879:6: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘unsigned int’ [-Wformat=]
 drivers/scsi/nsp32.c:280:69: note: in definition of macro ‘nsp32_msg’
 drivers/scsi/nsp32.c:879:52: note: format string is defined here
 drivers/scsi/nsp32.c: In function ‘nsp32_detect’:
 drivers/scsi/nsp32.c:2719:6: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘int’ [-Wformat=]
 drivers/scsi/nsp32.c:280:69: note: in definition of macro ‘nsp32_msg’
 drivers/scsi/nsp32.c:2719:22: note: format string is defined here
 drivers/scsi/nsp32.c:2719:6: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘int’ [-Wformat=]
 drivers/scsi/nsp32.c:280:69: note: in definition of macro ‘nsp32_msg’
 drivers/scsi/nsp32.c:2719:28: note: format string is defined here
 drivers/scsi/nsp32.c: In function ‘nsp32_suspend’:
 drivers/scsi/nsp32.c:3267:23: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 6 has type ‘pm_message_t’ {aka ‘struct pm_message’} [-Wformat=]
 drivers/scsi/nsp32.c:280:69: note: in definition of macro ‘nsp32_msg’
 drivers/scsi/nsp32.c:3267:56: note: format string is defined here

Cc: GOTO Masanori <gotom@debian.or.jp>
Cc: YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: gotom@debian.org
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/scsi/nsp32.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c
index 54abda4d07c64..134bbd2d8b667 100644
--- a/drivers/scsi/nsp32.c
+++ b/drivers/scsi/nsp32.c
@@ -876,7 +876,7 @@ static int nsp32_setup_sg_table(struct scsi_cmnd *SCpnt)
 
 			if (le32_to_cpu(sgt[i].len) > 0x10000) {
 				nsp32_msg(KERN_ERR,
-					"can't transfer over 64KB at a time, size=0x%lx", le32_to_cpu(sgt[i].len));
+					"can't transfer over 64KB at a time, size=0x%x", le32_to_cpu(sgt[i].len));
 				return FALSE;
 			}
 			nsp32_dbg(NSP32_DEBUG_SGLIST,
@@ -2716,7 +2716,7 @@ static int nsp32_detect(struct pci_dev *pdev)
 	res = request_region(host->io_port, host->n_io_port, "nsp32");
 	if (res == NULL) {
 		nsp32_msg(KERN_ERR, 
-			  "I/O region 0x%lx+0x%lx is already used",
+			  "I/O region 0x%x+0x%x is already used",
 			  data->BaseAddress, data->NumAddress);
 		goto free_irq;
         }
@@ -3264,7 +3264,8 @@ static int nsp32_suspend(struct pci_dev *pdev, pm_message_t state)
 {
 	struct Scsi_Host *host = pci_get_drvdata(pdev);
 
-	nsp32_msg(KERN_INFO, "pci-suspend: pdev=0x%p, state=%ld, slot=%s, host=0x%p", pdev, state, pci_name(pdev), host);
+	nsp32_msg(KERN_INFO, "pci-suspend: pdev=0x%p, state.event=%x, slot=%s, host=0x%p",
+		  pdev, state.event, pci_name(pdev), host);
 
 	pci_save_state     (pdev);
 	pci_disable_device (pdev);
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH 00/18] [Set 3] Rid W=1 warnings in SCSI
  2021-03-17  8:56 [PATCH 00/18] [Set 3] Rid W=1 warnings in SCSI Lee Jones
                   ` (17 preceding siblings ...)
  2021-03-17  8:57 ` [PATCH 18/18] scsi: nsp32: Correct expected types in debug print formatting Lee Jones
@ 2021-03-17  9:05 ` Lee Jones
  18 siblings, 0 replies; 20+ messages in thread
From: Lee Jones @ 2021-03-17  9:05 UTC (permalink / raw)
  To: linux-kernel, Adam Radford, Alan Cox, Andre Hedrick,
	Anil Gurumurthy, Artur Paszkiewicz, Bas Vermeulen, Bradley Grove,
	Brian Macy, c by, Christoph Hellwig, David Chaw, de Melo,
	Doug Ledford, GOTO Masanori, gotom, Hannes Reinecke,
	James E.J. Bottomley, Joel Jacobson, Khalid Aziz,
	Leonard N. Zubkoff, Linux GmbH, linux-scsi, Luben Tuikov,
	Martin K. Petersen, MPT-FusionLinux.pdl, MPT-FusionLinux.pdl,
	Richard Hirst, Sathya Prakash, Sreekanth Reddy,
	Sudarsana Kalluru, Suganath Prabu Subramani, YOKOTA Hiroshi

On Wed, 17 Mar 2021, Lee Jones wrote:

> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> 
> This set contains functional changes.
> 
> This set is part of a larger effort attempting to clean-up W=1
> kernel builds, which are currently overwhelmingly riddled with
> niggly little warnings.
> 
> Lee Jones (18):
>   scsi: aic94xx: aic94xx_dump: Remove code that has been unused for at
>     least 13 years
>   scsi: mpt3sas: mpt3sas_scs: Move a little data from the stack onto the
>     heap
>   scsi: bfa: bfa_fcs_lport: Move a large struct from the stack onto the
>     heap
>   scsi: esas2r: esas2r_log: Supply __printf(x, y) formatting for
>     esas2r_log_master()
>   scsi: BusLogic: Supply __printf(x, y) formatting for blogic_msg()
>   scsi: nsp32: Supply __printf(x, y) formatting for nsp32_message()
>   scsi: initio: Remove unused variable 'prev'
>   scsi: a100u2w: Remove unused variable 'bios_phys'
>   scsi: myrs: Remove a couple of unused 'status' variables
>   scsi: 3w-xxxx: Remove 2 unused variables 'response_que_value' and
>     'tw_dev'
>   scsi: 3w-9xxx: Remove a few set but unused variables
>   scsi: 3w-sas: Remove unused variables 'sglist' and 'tw_dev'
>   scsi: nsp32: Remove or exclude unused variables
>   scsi: FlashPoint: Remove unused variable 'TID' from
>     'FlashPoint_AbortCCB()'
>   scsi: sim710: Remove unused variable 'err' from sim710_init()
>   scsi: isci: port: Make local function 'port_state_name()' static
>   scsi: isci: remote_device: Make local function
>     isci_remote_device_wait_for_resume_from_abort() static
>   scsi: nsp32: Correct expected types in debug print formatting

Oh dear! Looks like I also took functional patches from sets that
have already been sent out.

Please silently disregard this set. Sorry for the noise.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2021-03-17  9:05 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-17  8:56 [PATCH 00/18] [Set 3] Rid W=1 warnings in SCSI Lee Jones
2021-03-17  8:56 ` [PATCH 01/18] scsi: aic94xx: aic94xx_dump: Remove code that has been unused for at least 13 years Lee Jones
2021-03-17  8:56 ` [PATCH 02/18] scsi: mpt3sas: mpt3sas_scs: Move a little data from the stack onto the heap Lee Jones
2021-03-17  8:56 ` [PATCH 03/18] scsi: bfa: bfa_fcs_lport: Move a large struct " Lee Jones
2021-03-17  8:56 ` [PATCH 04/18] scsi: esas2r: esas2r_log: Supply __printf(x, y) formatting for esas2r_log_master() Lee Jones
2021-03-17  8:56 ` [PATCH 05/18] scsi: BusLogic: Supply __printf(x, y) formatting for blogic_msg() Lee Jones
2021-03-17  8:56 ` [PATCH 06/18] scsi: nsp32: Supply __printf(x, y) formatting for nsp32_message() Lee Jones
2021-03-17  8:56 ` [PATCH 07/18] scsi: initio: Remove unused variable 'prev' Lee Jones
2021-03-17  8:56 ` [PATCH 08/18] scsi: a100u2w: Remove unused variable 'bios_phys' Lee Jones
2021-03-17  8:56 ` [PATCH 09/18] scsi: myrs: Remove a couple of unused 'status' variables Lee Jones
2021-03-17  8:56 ` [PATCH 10/18] scsi: 3w-xxxx: Remove 2 unused variables 'response_que_value' and 'tw_dev' Lee Jones
2021-03-17  8:56 ` [PATCH 11/18] scsi: 3w-9xxx: Remove a few set but unused variables Lee Jones
2021-03-17  8:56 ` [PATCH 12/18] scsi: 3w-sas: Remove unused variables 'sglist' and 'tw_dev' Lee Jones
2021-03-17  8:56 ` [PATCH 13/18] scsi: nsp32: Remove or exclude unused variables Lee Jones
2021-03-17  8:56 ` [PATCH 14/18] scsi: FlashPoint: Remove unused variable 'TID' from 'FlashPoint_AbortCCB()' Lee Jones
2021-03-17  8:56 ` [PATCH 15/18] scsi: sim710: Remove unused variable 'err' from sim710_init() Lee Jones
2021-03-17  8:56 ` [PATCH 16/18] scsi: isci: port: Make local function 'port_state_name()' static Lee Jones
2021-03-17  8:57 ` [PATCH 17/18] scsi: isci: remote_device: Make local function isci_remote_device_wait_for_resume_from_abort() static Lee Jones
2021-03-17  8:57 ` [PATCH 18/18] scsi: nsp32: Correct expected types in debug print formatting Lee Jones
2021-03-17  9:05 ` [PATCH 00/18] [Set 3] Rid W=1 warnings in SCSI Lee Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.