All of lore.kernel.org
 help / color / mirror / Atom feed
From: walter harms <wharms@bfs.de>
To: kernel-janitors@vger.kernel.org
Subject: Re: [PATCH -next] scsi: smartpqi: remove set but not used variable 'ctrl_info'
Date: Sun, 01 Sep 2019 13:04:19 +0000	[thread overview]
Message-ID: <5D6BC1D3.7040605@bfs.de> (raw)
In-Reply-To: <20190831130348.20552-1-yuehaibing@huawei.com>



Am 31.08.2019 15:03, schrieb YueHaibing:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/scsi/smartpqi/smartpqi_init.c: In function 'pqi_driver_version_show':
> drivers/scsi/smartpqi/smartpqi_init.c:6164:24: warning:
>  variable 'ctrl_info' set but not used [-Wunused-but-set-variable]
> 
> commit 6d90615f1346 ("scsi: smartpqi: add sysfs entries") add it but never
> use, so remove it also variable 'shost'
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/scsi/smartpqi/smartpqi_init.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
> index ea5409bebf57..b9e7dabee1e5 100644
> --- a/drivers/scsi/smartpqi/smartpqi_init.c
> +++ b/drivers/scsi/smartpqi/smartpqi_init.c
> @@ -6160,12 +6160,6 @@ static ssize_t pqi_firmware_version_show(struct device *dev,
>  static ssize_t pqi_driver_version_show(struct device *dev,
>  	struct device_attribute *attr, char *buffer)
>  {
> -	struct Scsi_Host *shost;
> -	struct pqi_ctrl_info *ctrl_info;
> -
> -	shost = class_to_shost(dev);
> -	ctrl_info = shost_to_hba(shost);
> -
>  	return snprintf(buffer, PAGE_SIZE,
>  		"%s\n", DRIVER_VERSION BUILD_TIMESTAMP);
>  }
> 

so, only snprintf() is left. That begs an other question:
Is that function need at all or can it be replaced with snprintf() ?

re,
 wh

  reply	other threads:[~2019-09-01 13:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-31 13:03 [PATCH -next] scsi: smartpqi: remove set but not used variable 'ctrl_info' YueHaibing
2019-08-31 13:03 ` YueHaibing
2019-09-01 13:04 ` walter harms [this message]
2019-09-03  7:48 ` Yuehaibing
2019-10-01  2:38 ` Martin K. Petersen
2019-10-01  2:38   ` Martin K. Petersen

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=5D6BC1D3.7040605@bfs.de \
    --to=wharms@bfs.de \
    --cc=kernel-janitors@vger.kernel.org \
    /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 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.