linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] cleanup patches for unused variables
@ 2020-01-16 11:56 yu kuai
  2020-01-16 11:56 ` [PATCH 1/3] scsi: aic7xxx: remove set but not used variable 'tinfo' yu kuai
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: yu kuai @ 2020-01-16 11:56 UTC (permalink / raw)
  To: hare, jejb, martin.petersen
  Cc: linux-scsi, linux-kernel, yukuai3, zhengbin13, yi.zhang

Remove three set but not used variables in
drivers/scsi/aic7xxx/aic7xxx_osm.c

yu kuai (3):
  scsi: aic7xxx: remove set but not used variable 'tinfo'
  scsi: aic7xxx: remove set but not used variable 'ahc'
  scsi: aic7xxx: remove set but not used variable 'targ'

 drivers/scsi/aic7xxx/aic7xxx_osm.c | 10 ----------
 include/scsi/scsi_transport.h      | 10 +---------
 2 files changed, 1 insertion(+), 19 deletions(-)

-- 
2.17.2


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

* [PATCH 1/3] scsi: aic7xxx: remove set but not used variable 'tinfo'
  2020-01-16 11:56 [PATCH 0/3] cleanup patches for unused variables yu kuai
@ 2020-01-16 11:56 ` yu kuai
  2020-01-16 11:56 ` [PATCH 2/3] scsi: aic7xxx: remove set but not used variable 'ahc' yu kuai
  2020-01-16 11:56 ` [PATCH 3/3] scsi: aic7xxx: remove set but not used variable 'targ' yu kuai
  2 siblings, 0 replies; 4+ messages in thread
From: yu kuai @ 2020-01-16 11:56 UTC (permalink / raw)
  To: hare, jejb, martin.petersen
  Cc: linux-scsi, linux-kernel, yukuai3, zhengbin13, yi.zhang

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/scsi/aic7xxx/aic7xxx_osm.c: In function
‘ahc_linux_target_alloc’:
drivers/scsi/aic7xxx/aic7xxx_osm.c:567:30: warning:
variable ‘tinfo’ set but not used [-Wunused-but-set-variable]

It is never used, and so can be removed.

Signed-off-by: yu kuai <yukuai3@huawei.com>
---
 drivers/scsi/aic7xxx/aic7xxx_osm.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c
index d5c4a0d23706..e99aa154f77a 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c
@@ -564,7 +564,6 @@ ahc_linux_target_alloc(struct scsi_target *starget)
 	struct scsi_target **ahc_targp = ahc_linux_target_in_softc(starget);
 	unsigned short scsirate;
 	struct ahc_devinfo devinfo;
-	struct ahc_initiator_tinfo *tinfo;
 	struct ahc_tmode_tstate *tstate;
 	char channel = starget->channel + 'A';
 	unsigned int our_id = ahc->our_id;
@@ -612,9 +611,6 @@ ahc_linux_target_alloc(struct scsi_target *starget)
 			spi_max_offset(starget) = 0;
 		spi_min_period(starget) = 
 			ahc_find_period(ahc, scsirate, maxsync);
-
-		tinfo = ahc_fetch_transinfo(ahc, channel, ahc->our_id,
-					    starget->id, &tstate);
 	}
 	ahc_compile_devinfo(&devinfo, our_id, starget->id,
 			    CAM_LUN_WILDCARD, channel,
-- 
2.17.2


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

* [PATCH 2/3] scsi: aic7xxx: remove set but not used variable 'ahc'
  2020-01-16 11:56 [PATCH 0/3] cleanup patches for unused variables yu kuai
  2020-01-16 11:56 ` [PATCH 1/3] scsi: aic7xxx: remove set but not used variable 'tinfo' yu kuai
@ 2020-01-16 11:56 ` yu kuai
  2020-01-16 11:56 ` [PATCH 3/3] scsi: aic7xxx: remove set but not used variable 'targ' yu kuai
  2 siblings, 0 replies; 4+ messages in thread
From: yu kuai @ 2020-01-16 11:56 UTC (permalink / raw)
  To: hare, jejb, martin.petersen
  Cc: linux-scsi, linux-kernel, yukuai3, zhengbin13, yi.zhang

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/scsi/aic7xxx/aic7xxx_osm.c: In function
‘ahc_linux_slave_configure’:
drivers/scsi/aic7xxx/aic7xxx_osm.c:674:20: warning:
variable ‘ahc’ set but not used [-Wunused-but-set-variable]

It is never used, and so can be removed.

Signed-off-by: yu kuai <yukuai3@huawei.com>
---
 drivers/scsi/aic7xxx/aic7xxx_osm.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c
index e99aa154f77a..2cda0736c989 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c
@@ -667,10 +667,6 @@ ahc_linux_slave_alloc(struct scsi_device *sdev)
 static int
 ahc_linux_slave_configure(struct scsi_device *sdev)
 {
-	struct	ahc_softc *ahc;
-
-	ahc = *((struct ahc_softc **)sdev->host->hostdata);
-
 	if (bootverbose)
 		sdev_printk(KERN_INFO, sdev, "Slave Configure\n");
 
-- 
2.17.2


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

* [PATCH 3/3] scsi: aic7xxx: remove set but not used variable 'targ'
  2020-01-16 11:56 [PATCH 0/3] cleanup patches for unused variables yu kuai
  2020-01-16 11:56 ` [PATCH 1/3] scsi: aic7xxx: remove set but not used variable 'tinfo' yu kuai
  2020-01-16 11:56 ` [PATCH 2/3] scsi: aic7xxx: remove set but not used variable 'ahc' yu kuai
@ 2020-01-16 11:56 ` yu kuai
  2 siblings, 0 replies; 4+ messages in thread
From: yu kuai @ 2020-01-16 11:56 UTC (permalink / raw)
  To: hare, jejb, martin.petersen
  Cc: linux-scsi, linux-kernel, yukuai3, zhengbin13, yi.zhang

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/scsi/aic7xxx/aic7xxx_osm.c: In function ‘ahc_send_async’:
drivers/scsi/aic7xxx/aic7xxx_osm.c:1611:28: warning: variable
‘targ’ set but not used [-Wunused-but-set-variable]

It is never used, and so can be removed. In this case
scsi_transport_target_data() can be removed because of no caller exist.

Signed-off-by: yu kuai <yukuai3@huawei.com>
---
 drivers/scsi/aic7xxx/aic7xxx_osm.c |  2 --
 include/scsi/scsi_transport.h      | 10 +---------
 2 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c
index 2cda0736c989..33fc55c6b2f4 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c
@@ -1600,7 +1600,6 @@ ahc_send_async(struct ahc_softc *ahc, char channel,
 	case AC_TRANSFER_NEG:
 	{
 		struct	scsi_target *starget;
-		struct	ahc_linux_target *targ;
 		struct	ahc_initiator_tinfo *tinfo;
 		struct	ahc_tmode_tstate *tstate;
 		int	target_offset;
@@ -1634,7 +1633,6 @@ ahc_send_async(struct ahc_softc *ahc, char channel,
 		starget = ahc->platform_data->starget[target_offset];
 		if (starget == NULL)
 			break;
-		targ = scsi_transport_target_data(starget);
 
 		target_ppr_options =
 			(spi_dt(starget) ? MSG_EXT_PPR_DT_REQ : 0)
diff --git a/include/scsi/scsi_transport.h b/include/scsi/scsi_transport.h
index a0458bda3148..2cffdb34721d 100644
--- a/include/scsi/scsi_transport.h
+++ b/include/scsi/scsi_transport.h
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-/* 
+/*
  *  Transport specific attributes.
  *
  *  Copyright (c) 2003 Silicon Graphics, Inc.  All rights reserved.
@@ -68,14 +68,6 @@ scsi_transport_reserve_device(struct scsi_transport_template * t, int space)
 	t->device_size = t->device_private_offset + space;
 }
 static inline void *
-scsi_transport_target_data(struct scsi_target *starget)
-{
-	struct Scsi_Host *shost = dev_to_shost(&starget->dev);
-	return (u8 *)starget->starget_data
-		+ shost->transportt->target_private_offset;
-
-}
-static inline void *
 scsi_transport_device_data(struct scsi_device *sdev)
 {
 	struct Scsi_Host *shost = sdev->host;
-- 
2.17.2


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

end of thread, other threads:[~2020-01-16 11:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-16 11:56 [PATCH 0/3] cleanup patches for unused variables yu kuai
2020-01-16 11:56 ` [PATCH 1/3] scsi: aic7xxx: remove set but not used variable 'tinfo' yu kuai
2020-01-16 11:56 ` [PATCH 2/3] scsi: aic7xxx: remove set but not used variable 'ahc' yu kuai
2020-01-16 11:56 ` [PATCH 3/3] scsi: aic7xxx: remove set but not used variable 'targ' yu kuai

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).