* [PATCH] scsi: fix Wunused-but-set-variable buildwarning
@ 2015-05-14 18:12 Nicholas Mc Guire
2015-05-14 22:39 ` vasu.dev-VuQAYsv1563Yd54FQh9/CA
2015-05-14 23:24 ` [Open-FCoE] " Prasad Gondi
0 siblings, 2 replies; 8+ messages in thread
From: Nicholas Mc Guire @ 2015-05-14 18:12 UTC (permalink / raw)
To: Vasu Dev
Cc: James E.J. Bottomley, fcoe-devel, linux-scsi, linux-kernel,
Nicholas Mc Guire
commit "[SCSI] libfc: remove tgt_flags from fc_fcp_pkt struct"
removed the last usage of rpriv (rpriv->flags) but forgot to remove
the unused rpriv struct resulting in:
drivers/scsi/libfc/fc_fcp.c: In function 'fc_queuecommand':
drivers/scsi/libfc/fc_fcp.c:1795:30: warning: variable 'rpriv' set
but not used [-Wunused-but-set-variable]
so simply drop its declaration and setting.
Patch was compile tested with x86_64_defconfig + SCSI_LOWLEVEL=y,
CONFIG_SCSI_FC_ATTRS=m, CONFIG_LIBFC=m
Patch is against 4.1-rc3 (localversion-next is -next-20150514)
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---
drivers/scsi/libfc/fc_fcp.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index c438b81..fee6928 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -1792,7 +1792,6 @@ int fc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc_cmd)
struct fc_lport *lport = shost_priv(shost);
struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device));
struct fc_fcp_pkt *fsp;
- struct fc_rport_libfc_priv *rpriv;
int rval;
int rc = 0;
struct fc_stats *stats;
@@ -1814,8 +1813,6 @@ int fc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc_cmd)
goto out;
}
- rpriv = rport->dd_data;
-
if (!fc_fcp_lport_queue_ready(lport)) {
if (lport->qfull)
fc_fcp_can_queue_ramp_down(lport);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Open-FCoE] [PATCH] scsi: fix Wunused-but-set-variable buildwarning
@ 2015-05-14 22:39 ` vasu.dev-VuQAYsv1563Yd54FQh9/CA
0 siblings, 0 replies; 8+ messages in thread
From: vasu.dev @ 2015-05-14 22:39 UTC (permalink / raw)
To: Nicholas Mc Guire
Cc: Vasu Dev, fcoe-devel, James E.J. Bottomley, linux-kernel, linux-scsi
On Thu, 2015-05-14 at 20:12 +0200, Nicholas Mc Guire wrote:
> commit "[SCSI] libfc: remove tgt_flags from fc_fcp_pkt struct"
> removed the last usage of rpriv (rpriv->flags) but forgot to remove
> the unused rpriv struct resulting in:
> drivers/scsi/libfc/fc_fcp.c: In function 'fc_queuecommand':
> drivers/scsi/libfc/fc_fcp.c:1795:30: warning: variable 'rpriv' set
> but not used [-Wunused-but-set-variable]
> so simply drop its declaration and setting.
>
> Patch was compile tested with x86_64_defconfig + SCSI_LOWLEVEL=y,
> CONFIG_SCSI_FC_ATTRS=m, CONFIG_LIBFC=m
>
> Patch is against 4.1-rc3 (localversion-next is -next-20150514)
>
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> ---
>
> drivers/scsi/libfc/fc_fcp.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
> index c438b81..fee6928 100644
> --- a/drivers/scsi/libfc/fc_fcp.c
> +++ b/drivers/scsi/libfc/fc_fcp.c
> @@ -1792,7 +1792,6 @@ int fc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc_cmd)
> struct fc_lport *lport = shost_priv(shost);
> struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device));
> struct fc_fcp_pkt *fsp;
> - struct fc_rport_libfc_priv *rpriv;
> int rval;
> int rc = 0;
> struct fc_stats *stats;
> @@ -1814,8 +1813,6 @@ int fc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc_cmd)
> goto out;
> }
>
> - rpriv = rport->dd_data;
> -
> if (!fc_fcp_lport_queue_ready(lport)) {
> if (lport->qfull)
> fc_fcp_can_queue_ramp_down(lport);
Looks good, Thx
Acked-by: Vasu Dev <vasu.dev@intel.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] scsi: fix Wunused-but-set-variable buildwarning
@ 2015-05-14 22:39 ` vasu.dev-VuQAYsv1563Yd54FQh9/CA
0 siblings, 0 replies; 8+ messages in thread
From: vasu.dev-VuQAYsv1563Yd54FQh9/CA @ 2015-05-14 22:39 UTC (permalink / raw)
To: Nicholas Mc Guire
Cc: fcoe-devel-s9riP+hp16TNLxjTenLetw, James E.J. Bottomley,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-scsi-u79uwXL29TY76Z2rM5mHXA
On Thu, 2015-05-14 at 20:12 +0200, Nicholas Mc Guire wrote:
> commit "[SCSI] libfc: remove tgt_flags from fc_fcp_pkt struct"
> removed the last usage of rpriv (rpriv->flags) but forgot to remove
> the unused rpriv struct resulting in:
> drivers/scsi/libfc/fc_fcp.c: In function 'fc_queuecommand':
> drivers/scsi/libfc/fc_fcp.c:1795:30: warning: variable 'rpriv' set
> but not used [-Wunused-but-set-variable]
> so simply drop its declaration and setting.
>
> Patch was compile tested with x86_64_defconfig + SCSI_LOWLEVEL=y,
> CONFIG_SCSI_FC_ATTRS=m, CONFIG_LIBFC=m
>
> Patch is against 4.1-rc3 (localversion-next is -next-20150514)
>
> Signed-off-by: Nicholas Mc Guire <hofrat-Q945KHDl0DbYtjvyW6yDsg@public.gmane.org>
> ---
>
> drivers/scsi/libfc/fc_fcp.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
> index c438b81..fee6928 100644
> --- a/drivers/scsi/libfc/fc_fcp.c
> +++ b/drivers/scsi/libfc/fc_fcp.c
> @@ -1792,7 +1792,6 @@ int fc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc_cmd)
> struct fc_lport *lport = shost_priv(shost);
> struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device));
> struct fc_fcp_pkt *fsp;
> - struct fc_rport_libfc_priv *rpriv;
> int rval;
> int rc = 0;
> struct fc_stats *stats;
> @@ -1814,8 +1813,6 @@ int fc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc_cmd)
> goto out;
> }
>
> - rpriv = rport->dd_data;
> -
> if (!fc_fcp_lport_queue_ready(lport)) {
> if (lport->qfull)
> fc_fcp_can_queue_ramp_down(lport);
Looks good, Thx
Acked-by: Vasu Dev <vasu.dev-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [Open-FCoE] [PATCH] scsi: fix Wunused-but-set-variable buildwarning
2015-05-14 18:12 [PATCH] scsi: fix Wunused-but-set-variable buildwarning Nicholas Mc Guire
2015-05-14 22:39 ` vasu.dev-VuQAYsv1563Yd54FQh9/CA
@ 2015-05-14 23:24 ` Prasad Gondi
2015-05-15 7:14 ` Nicholas Mc Guire
1 sibling, 1 reply; 8+ messages in thread
From: Prasad Gondi @ 2015-05-14 23:24 UTC (permalink / raw)
To: Nicholas Mc Guire, Vasu Dev
Cc: fcoe-devel, James E.J. Bottomley, linux-kernel, linux-scsi
It seems like rpriv is used to set the fsp->tgt_flags originally
> fsp->tgt_flags = rpriv->flags
And fsp->tgt_flags are used in "fc_fcp_cmd_send" like this
setup_timer(&fsp->timer, fc_fcp_timeout, (unsigned long)fsp);
if (rpriv->flags & FC_RP_FLAGS_REC_SUPPORTED)
fc_fcp_timer_set(fsp, get_fsp_rec_tov(fsp));
Main purpose of this flags used is to set the correct TimeOut Value for fc_fcp_timer.
So is the removal of the "fsp->tgt_flags = rpriv->flags" in fc_queuecommand() is intentional? Or by mistake?
Once we clear that out we can see whether this change make sense?
Thanks,
Prasad Gondi
-----Original Message-----
From: fcoe-devel [mailto:fcoe-devel-bounces@open-fcoe.org] On Behalf Of Nicholas Mc Guire
Sent: Thursday, May 14, 2015 11:13 AM
To: Vasu Dev
Cc: fcoe-devel@open-fcoe.org; James E.J. Bottomley; linux-kernel@vger.kernel.org; linux-scsi@vger.kernel.org; Nicholas Mc Guire
Subject: [Open-FCoE] [PATCH] scsi: fix Wunused-but-set-variable buildwarning
commit "[SCSI] libfc: remove tgt_flags from fc_fcp_pkt struct"
removed the last usage of rpriv (rpriv->flags) but forgot to remove the unused rpriv struct resulting in:
drivers/scsi/libfc/fc_fcp.c: In function 'fc_queuecommand':
drivers/scsi/libfc/fc_fcp.c:1795:30: warning: variable 'rpriv' set
but not used [-Wunused-but-set-variable] so simply drop its declaration and setting.
Patch was compile tested with x86_64_defconfig + SCSI_LOWLEVEL=y, CONFIG_SCSI_FC_ATTRS=m, CONFIG_LIBFC=m
Patch is against 4.1-rc3 (localversion-next is -next-20150514)
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---
drivers/scsi/libfc/fc_fcp.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c index c438b81..fee6928 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -1792,7 +1792,6 @@ int fc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc_cmd)
struct fc_lport *lport = shost_priv(shost);
struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device));
struct fc_fcp_pkt *fsp;
- struct fc_rport_libfc_priv *rpriv;
int rval;
int rc = 0;
struct fc_stats *stats;
@@ -1814,8 +1813,6 @@ int fc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc_cmd)
goto out;
}
- rpriv = rport->dd_data;
-
if (!fc_fcp_lport_queue_ready(lport)) {
if (lport->qfull)
fc_fcp_can_queue_ramp_down(lport);
--
1.7.10.4
_______________________________________________
fcoe-devel mailing list
fcoe-devel@open-fcoe.org
https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.open-2Dfcoe.org_mailman_listinfo_fcoe-2Ddevel&d=AwICAg&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=wjT-lROQxgFnmIgeyNof2ACTY91g4HqkQGUkJo2HQ0k&m=CyBs5yDLeN-k1LsnaCsHCdi06s2NEU0XemK8ry1EDg0&s=8x44EVd0jYu65AU-LSkgpi49VN9OIj9P6sDqg9AmLVo&e=
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Open-FCoE] [PATCH] scsi: fix Wunused-but-set-variable buildwarning
2015-05-14 23:24 ` [Open-FCoE] " Prasad Gondi
@ 2015-05-15 7:14 ` Nicholas Mc Guire
2015-05-15 17:09 ` vasu.dev
0 siblings, 1 reply; 8+ messages in thread
From: Nicholas Mc Guire @ 2015-05-15 7:14 UTC (permalink / raw)
To: Prasad Gondi
Cc: Nicholas Mc Guire, Vasu Dev, fcoe-devel, James E.J. Bottomley,
linux-kernel, linux-scsi
On Thu, 14 May 2015, Prasad Gondi wrote:
> It seems like rpriv is used to set the fsp->tgt_flags originally
>
> > fsp->tgt_flags = rpriv->flags
>
> And fsp->tgt_flags are used in "fc_fcp_cmd_send" like this
>
> setup_timer(&fsp->timer, fc_fcp_timeout, (unsigned long)fsp);
> if (rpriv->flags & FC_RP_FLAGS_REC_SUPPORTED)
> fc_fcp_timer_set(fsp, get_fsp_rec_tov(fsp));
>
> Main purpose of this flags used is to set the correct TimeOut Value for fc_fcp_timer.
>
> So is the removal of the "fsp->tgt_flags = rpriv->flags" in fc_queuecommand() is intentional? Or by mistake?
>
thats something I can't say - but the commit message indicated that the
removal of tgt_flags was intentional.
> Once we clear that out we can see whether this change make sense?
>
yup - many thanks !
hofrat
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Open-FCoE] [PATCH] scsi: fix Wunused-but-set-variable buildwarning
2015-05-15 7:14 ` Nicholas Mc Guire
@ 2015-05-15 17:09 ` vasu.dev
2015-05-15 17:12 ` Prasad Gondi
0 siblings, 1 reply; 8+ messages in thread
From: vasu.dev @ 2015-05-15 17:09 UTC (permalink / raw)
To: Nicholas Mc Guire
Cc: Prasad Gondi, linux-scsi, James E.J. Bottomley, linux-kernel,
Nicholas Mc Guire, fcoe-devel
On Fri, 2015-05-15 at 09:14 +0200, Nicholas Mc Guire wrote:
> On Thu, 14 May 2015, Prasad Gondi wrote:
>
> > It seems like rpriv is used to set the fsp->tgt_flags originally
> >
> > > fsp->tgt_flags = rpriv->flags
> >
> > And fsp->tgt_flags are used in "fc_fcp_cmd_send" like this
> >
> > setup_timer(&fsp->timer, fc_fcp_timeout, (unsigned long)fsp);
> > if (rpriv->flags & FC_RP_FLAGS_REC_SUPPORTED)
> > fc_fcp_timer_set(fsp, get_fsp_rec_tov(fsp));
> >
> > Main purpose of this flags used is to set the correct TimeOut Value for fc_fcp_timer.
> >
> > So is the removal of the "fsp->tgt_flags = rpriv->flags" in fc_queuecommand() is intentional? Or by mistake?
> >
> thats something I can't say - but the commit message indicated that the
> removal of tgt_flags was intentional.
>
It was intentional and good cleanup since now rpriv->flags is used
directly with that change instead of storing in fsp->tgt_flags as it was
before.
> > Once we clear that out we can see whether this change make sense?
> >
Anycase the patch under discussion is straight forward clean up patch
since it just removes a local stack variable which is not used.
Thanks,
Vasu
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [Open-FCoE] [PATCH] scsi: fix Wunused-but-set-variable buildwarning
2015-05-15 17:09 ` vasu.dev
@ 2015-05-15 17:12 ` Prasad Gondi
0 siblings, 0 replies; 8+ messages in thread
From: Prasad Gondi @ 2015-05-15 17:12 UTC (permalink / raw)
To: vasu.dev, Nicholas Mc Guire
Cc: linux-scsi, James E.J. Bottomley, linux-kernel,
Nicholas Mc Guire, fcoe-devel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1927 bytes --]
Thanks Vasu for the details.
I agree current patch is good to go. I have no objections and it is an extension to the older patch which removed the " fsp->tgt_flags" flags.
Thanks,
Prasad
-----Original Message-----
From: vasu.dev@linux.intel.com [mailto:vasu.dev@linux.intel.com]
Sent: Friday, May 15, 2015 10:10 AM
To: Nicholas Mc Guire
Cc: Prasad Gondi; linux-scsi@vger.kernel.org; James E.J. Bottomley; linux-kernel@vger.kernel.org; Nicholas Mc Guire; fcoe-devel@open-fcoe.org
Subject: Re: [Open-FCoE] [PATCH] scsi: fix Wunused-but-set-variable buildwarning
On Fri, 2015-05-15 at 09:14 +0200, Nicholas Mc Guire wrote:
> On Thu, 14 May 2015, Prasad Gondi wrote:
>
> > It seems like rpriv is used to set the fsp->tgt_flags originally
> >
> > > fsp->tgt_flags = rpriv->flags
> >
> > And fsp->tgt_flags are used in "fc_fcp_cmd_send" like this
> >
> > setup_timer(&fsp->timer, fc_fcp_timeout, (unsigned long)fsp);
> > if (rpriv->flags & FC_RP_FLAGS_REC_SUPPORTED)
> > fc_fcp_timer_set(fsp, get_fsp_rec_tov(fsp));
> >
> > Main purpose of this flags used is to set the correct TimeOut Value for fc_fcp_timer.
> >
> > So is the removal of the "fsp->tgt_flags = rpriv->flags" in fc_queuecommand() is intentional? Or by mistake?
> >
> thats something I can't say - but the commit message indicated that
> the removal of tgt_flags was intentional.
>
It was intentional and good cleanup since now rpriv->flags is used directly with that change instead of storing in fsp->tgt_flags as it was before.
> > Once we clear that out we can see whether this change make sense?
> >
Anycase the patch under discussion is straight forward clean up patch since it just removes a local stack variable which is not used.
Thanks,
Vasu
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [Open-FCoE] [PATCH] scsi: fix Wunused-but-set-variable buildwarning
@ 2015-05-15 17:12 ` Prasad Gondi
0 siblings, 0 replies; 8+ messages in thread
From: Prasad Gondi @ 2015-05-15 17:12 UTC (permalink / raw)
To: vasu.dev, Nicholas Mc Guire
Cc: linux-scsi, James E.J. Bottomley, linux-kernel,
Nicholas Mc Guire, fcoe-devel
Thanks Vasu for the details.
I agree current patch is good to go. I have no objections and it is an extension to the older patch which removed the " fsp->tgt_flags" flags.
Thanks,
Prasad
-----Original Message-----
From: vasu.dev@linux.intel.com [mailto:vasu.dev@linux.intel.com]
Sent: Friday, May 15, 2015 10:10 AM
To: Nicholas Mc Guire
Cc: Prasad Gondi; linux-scsi@vger.kernel.org; James E.J. Bottomley; linux-kernel@vger.kernel.org; Nicholas Mc Guire; fcoe-devel@open-fcoe.org
Subject: Re: [Open-FCoE] [PATCH] scsi: fix Wunused-but-set-variable buildwarning
On Fri, 2015-05-15 at 09:14 +0200, Nicholas Mc Guire wrote:
> On Thu, 14 May 2015, Prasad Gondi wrote:
>
> > It seems like rpriv is used to set the fsp->tgt_flags originally
> >
> > > fsp->tgt_flags = rpriv->flags
> >
> > And fsp->tgt_flags are used in "fc_fcp_cmd_send" like this
> >
> > setup_timer(&fsp->timer, fc_fcp_timeout, (unsigned long)fsp);
> > if (rpriv->flags & FC_RP_FLAGS_REC_SUPPORTED)
> > fc_fcp_timer_set(fsp, get_fsp_rec_tov(fsp));
> >
> > Main purpose of this flags used is to set the correct TimeOut Value for fc_fcp_timer.
> >
> > So is the removal of the "fsp->tgt_flags = rpriv->flags" in fc_queuecommand() is intentional? Or by mistake?
> >
> thats something I can't say - but the commit message indicated that
> the removal of tgt_flags was intentional.
>
It was intentional and good cleanup since now rpriv->flags is used directly with that change instead of storing in fsp->tgt_flags as it was before.
> > Once we clear that out we can see whether this change make sense?
> >
Anycase the patch under discussion is straight forward clean up patch since it just removes a local stack variable which is not used.
Thanks,
Vasu
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-05-15 17:12 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-14 18:12 [PATCH] scsi: fix Wunused-but-set-variable buildwarning Nicholas Mc Guire
2015-05-14 22:39 ` [Open-FCoE] " vasu.dev
2015-05-14 22:39 ` vasu.dev-VuQAYsv1563Yd54FQh9/CA
2015-05-14 23:24 ` [Open-FCoE] " Prasad Gondi
2015-05-15 7:14 ` Nicholas Mc Guire
2015-05-15 17:09 ` vasu.dev
2015-05-15 17:12 ` Prasad Gondi
2015-05-15 17:12 ` Prasad Gondi
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.