linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: yu kuai <yukuai3@huawei.com>
To: <hare@suse.com>, <jejb@linux.ibm.com>, <martin.petersen@oracle.com>
Cc: <linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<yukuai3@huawei.com>, <zhengbin13@huawei.com>,
	<yi.zhang@huawei.com>
Subject: [PATCH 3/3] scsi: aic7xxx: remove set but not used variable 'targ'
Date: Thu, 16 Jan 2020 19:56:03 +0800	[thread overview]
Message-ID: <20200116115603.25386-4-yukuai3@huawei.com> (raw)
In-Reply-To: <20200116115603.25386-1-yukuai3@huawei.com>

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


      parent reply	other threads:[~2020-01-16 11:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [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=20200116115603.25386-4-yukuai3@huawei.com \
    --to=yukuai3@huawei.com \
    --cc=hare@suse.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=yi.zhang@huawei.com \
    --cc=zhengbin13@huawei.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).