All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] scsi: qedf: remove set but not used variable 'fcport'
@ 2018-10-19 12:12 YueHaibing
  2018-10-19 17:30 ` Ewan D. Milne
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: YueHaibing @ 2018-10-19 12:12 UTC (permalink / raw)
  To: kernel-janitors

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

drivers/scsi/qedf/qedf_main.c: In function 'qedf_eh_abort':
drivers/scsi/qedf/qedf_main.c:619:21: warning:
 variable 'fcport' set but not used [-Wunused-but-set-variable]
  struct qedf_rport *fcport;

It never used since introduction in
commit 61d8658b4a43 ("scsi: qedf: Add QLogic FastLinQ offload FCoE driver framework.")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/scsi/qedf/qedf_main.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index d5a4f17..04f50a3 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -615,8 +615,6 @@ static u32 qedf_get_login_failures(void *cookie)
 static int qedf_eh_abort(struct scsi_cmnd *sc_cmd)
 {
 	struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device));
-	struct fc_rport_libfc_priv *rp = rport->dd_data;
-	struct qedf_rport *fcport;
 	struct fc_lport *lport;
 	struct qedf_ctx *qedf;
 	struct qedf_ioreq *io_req;
@@ -636,8 +634,6 @@ static int qedf_eh_abort(struct scsi_cmnd *sc_cmd)
 		goto out;
 	}
 
-	fcport = (struct qedf_rport *)&rp[1];
-
 	io_req = (struct qedf_ioreq *)sc_cmd->SCp.ptr;
 	if (!io_req) {
 		QEDF_ERR(&(qedf->dbg_ctx), "io_req is NULL.\n");

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

* Re: [PATCH -next] scsi: qedf: remove set but not used variable 'fcport'
  2018-10-19 12:12 [PATCH -next] scsi: qedf: remove set but not used variable 'fcport' YueHaibing
@ 2018-10-19 17:30 ` Ewan D. Milne
  2019-03-30  1:47 ` [PATCH -next] scsi: qedf: Remove set but not used variable 'fr_len' YueHaibing
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Ewan D. Milne @ 2018-10-19 17:30 UTC (permalink / raw)
  To: kernel-janitors

On Fri, 2018-10-19 at 12:12 +0000, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/scsi/qedf/qedf_main.c: In function 'qedf_eh_abort':
> drivers/scsi/qedf/qedf_main.c:619:21: warning:
>  variable 'fcport' set but not used [-Wunused-but-set-variable]
>   struct qedf_rport *fcport;
> 
> It never used since introduction in
> commit 61d8658b4a43 ("scsi: qedf: Add QLogic FastLinQ offload FCoE
> driver framework.")
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/scsi/qedf/qedf_main.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/scsi/qedf/qedf_main.c
> b/drivers/scsi/qedf/qedf_main.c
> index d5a4f17..04f50a3 100644
> --- a/drivers/scsi/qedf/qedf_main.c
> +++ b/drivers/scsi/qedf/qedf_main.c
> @@ -615,8 +615,6 @@ static u32 qedf_get_login_failures(void *cookie)
>  static int qedf_eh_abort(struct scsi_cmnd *sc_cmd)
>  {
>  	struct fc_rport *rport > starget_to_rport(scsi_target(sc_cmd->device));
> -	struct fc_rport_libfc_priv *rp = rport->dd_data;
> -	struct qedf_rport *fcport;
>  	struct fc_lport *lport;
>  	struct qedf_ctx *qedf;
>  	struct qedf_ioreq *io_req;
> @@ -636,8 +634,6 @@ static int qedf_eh_abort(struct scsi_cmnd
> *sc_cmd)
>  		goto out;
>  	}
>  
> -	fcport = (struct qedf_rport *)&rp[1];
> -
>  	io_req = (struct qedf_ioreq *)sc_cmd->SCp.ptr;
>  	if (!io_req) {
>  		QEDF_ERR(&(qedf->dbg_ctx), "io_req is NULL.\n");
> 
> 
> 

Yes, but qedf_eh_host_reset() checks if (fcport = NULL) and
returns FAILED and it's not clear that qedf_eh_abort() shouldn't
do the same thing, consider that qedf_process_cqe() checks
whether io_req->fcport = NULL so it does not seem clear that
the io_req->fcport from sc_cmd->SCp.ptr will always be valid later...

Can someone from Cavium (Chad) comment?

-Ewan

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

* [PATCH -next] scsi: qedf: Remove set but not used variable 'fr_len'
  2018-10-19 12:12 [PATCH -next] scsi: qedf: remove set but not used variable 'fcport' YueHaibing
  2018-10-19 17:30 ` Ewan D. Milne
@ 2019-03-30  1:47 ` YueHaibing
  2019-04-02  6:55 ` Manish Rangankar
  2019-04-04  3:16 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: YueHaibing @ 2019-03-30  1:47 UTC (permalink / raw)
  To: kernel-janitors

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

drivers/scsi/qedf/qedf_fip.c: In function 'qedf_fcoe_send_vlan_req':
drivers/scsi/qedf/qedf_fip.c:22:6: warning:
 variable 'fr_len' set but not used [-Wunused-but-set-variable]

It's never used since introduction and can be removed.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/scsi/qedf/qedf_fip.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/scsi/qedf/qedf_fip.c b/drivers/scsi/qedf/qedf_fip.c
index 766da74fa546..49d0724535e3 100644
--- a/drivers/scsi/qedf/qedf_fip.c
+++ b/drivers/scsi/qedf/qedf_fip.c
@@ -19,7 +19,6 @@ void qedf_fcoe_send_vlan_req(struct qedf_ctx *qedf)
 {
 	struct sk_buff *skb;
 	char *eth_fr;
-	int fr_len;
 	struct fip_vlan *vlan;
 #define MY_FIP_ALL_FCF_MACS        ((__u8[6]) { 1, 0x10, 0x18, 1, 0, 2 })
 	static u8 my_fcoe_all_fcfs[ETH_ALEN] = MY_FIP_ALL_FCF_MACS;
@@ -29,7 +28,6 @@ void qedf_fcoe_send_vlan_req(struct qedf_ctx *qedf)
 	if (!skb)
 		return;
 
-	fr_len = sizeof(*vlan);
 	eth_fr = (char *)skb->data;
 	vlan = (struct fip_vlan *)eth_fr;

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

* RE: [PATCH -next] scsi: qedf: Remove set but not used variable 'fr_len'
  2018-10-19 12:12 [PATCH -next] scsi: qedf: remove set but not used variable 'fcport' YueHaibing
  2018-10-19 17:30 ` Ewan D. Milne
  2019-03-30  1:47 ` [PATCH -next] scsi: qedf: Remove set but not used variable 'fr_len' YueHaibing
@ 2019-04-02  6:55 ` Manish Rangankar
  2019-04-04  3:16 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Manish Rangankar @ 2019-04-02  6:55 UTC (permalink / raw)
  To: kernel-janitors


> -----Original Message-----
> From: linux-scsi-owner@vger.kernel.org <linux-scsi-owner@vger.kernel.org>
> On Behalf Of YueHaibing
> Sent: Saturday, March 30, 2019 7:18 AM
> To: James E . J . Bottomley <jejb@linux.ibm.com>; Martin K. Petersen
> <martin.petersen@oracle.com>
> Cc: YueHaibing <yuehaibing@huawei.com>; QLogic-Storage-
> Upstream@cavium.com; linux-scsi@vger.kernel.org; kernel-
> janitors@vger.kernel.org
> Subject: [PATCH -next] scsi: qedf: Remove set but not used variable 'fr_len'
> 
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/scsi/qedf/qedf_fip.c: In function 'qedf_fcoe_send_vlan_req':
> drivers/scsi/qedf/qedf_fip.c:22:6: warning:
>  variable 'fr_len' set but not used [-Wunused-but-set-variable]
> 
> It's never used since introduction and can be removed.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/scsi/qedf/qedf_fip.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/scsi/qedf/qedf_fip.c b/drivers/scsi/qedf/qedf_fip.c index
> 766da74fa546..49d0724535e3 100644
> --- a/drivers/scsi/qedf/qedf_fip.c
> +++ b/drivers/scsi/qedf/qedf_fip.c
> @@ -19,7 +19,6 @@ void qedf_fcoe_send_vlan_req(struct qedf_ctx *qedf)
> {
>  	struct sk_buff *skb;
>  	char *eth_fr;
> -	int fr_len;
>  	struct fip_vlan *vlan;
>  #define MY_FIP_ALL_FCF_MACS        ((__u8[6]) { 1, 0x10, 0x18, 1, 0, 2 })
>  	static u8 my_fcoe_all_fcfs[ETH_ALEN] = MY_FIP_ALL_FCF_MACS;
> @@ -29,7 +28,6 @@ void qedf_fcoe_send_vlan_req(struct qedf_ctx *qedf)
>  	if (!skb)
>  		return;
> 
> -	fr_len = sizeof(*vlan);
>  	eth_fr = (char *)skb->data;
>  	vlan = (struct fip_vlan *)eth_fr;
> 
> 

Thanks,
Acked-by: Manish Rangankar <mrangankar@marvell.com>

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

* Re: [PATCH -next] scsi: qedf: Remove set but not used variable 'fr_len'
  2018-10-19 12:12 [PATCH -next] scsi: qedf: remove set but not used variable 'fcport' YueHaibing
                   ` (2 preceding siblings ...)
  2019-04-02  6:55 ` Manish Rangankar
@ 2019-04-04  3:16 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2019-04-04  3:16 UTC (permalink / raw)
  To: kernel-janitors


YueHaibing,

> drivers/scsi/qedf/qedf_fip.c: In function 'qedf_fcoe_send_vlan_req':
> drivers/scsi/qedf/qedf_fip.c:22:6: warning:
>  variable 'fr_len' set but not used [-Wunused-but-set-variable]

Applied to 5.2/scsi-queue, thanks.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2019-04-04  3:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-19 12:12 [PATCH -next] scsi: qedf: remove set but not used variable 'fcport' YueHaibing
2018-10-19 17:30 ` Ewan D. Milne
2019-03-30  1:47 ` [PATCH -next] scsi: qedf: Remove set but not used variable 'fr_len' YueHaibing
2019-04-02  6:55 ` Manish Rangankar
2019-04-04  3:16 ` Martin K. Petersen

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.