netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: socionext: remove set but not used variable 'pkts'
@ 2019-07-03  2:42 YueHaibing
  2019-07-03  5:12 ` Ilias Apalodimas
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: YueHaibing @ 2019-07-03  2:42 UTC (permalink / raw)
  To: Jassi Brar, Alexei Starovoitov, David S . Miller,
	Ilias Apalodimas, Daniel Borkmann, Jakub Kicinski,
	Jesper Dangaard Brouer
  Cc: YueHaibing, netdev, xdp-newbies, bpf, kernel-janitors

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

drivers/net/ethernet/socionext/netsec.c: In function 'netsec_clean_tx_dring':
drivers/net/ethernet/socionext/netsec.c:637:15: warning:
 variable 'pkts' set but not used [-Wunused-but-set-variable]

It is not used since commit ba2b232108d3 ("net: netsec: add XDP support")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/net/ethernet/socionext/netsec.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c
index 5544a722543f..015d1ec5436a 100644
--- a/drivers/net/ethernet/socionext/netsec.c
+++ b/drivers/net/ethernet/socionext/netsec.c
@@ -634,7 +634,7 @@ static void netsec_set_rx_de(struct netsec_priv *priv,
 static bool netsec_clean_tx_dring(struct netsec_priv *priv)
 {
 	struct netsec_desc_ring *dring = &priv->desc_ring[NETSEC_RING_TX];
-	unsigned int pkts, bytes;
+	unsigned int bytes;
 	struct netsec_de *entry;
 	int tail = dring->tail;
 	int cnt = 0;
@@ -642,7 +642,6 @@ static bool netsec_clean_tx_dring(struct netsec_priv *priv)
 	if (dring->is_xdp)
 		spin_lock(&dring->lock);
 
-	pkts = 0;
 	bytes = 0;
 	entry = dring->vaddr + DESC_SZ * tail;




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

* Re: [PATCH net-next] net: socionext: remove set but not used variable 'pkts'
  2019-07-03  2:42 [PATCH net-next] net: socionext: remove set but not used variable 'pkts' YueHaibing
@ 2019-07-03  5:12 ` Ilias Apalodimas
  2019-07-03 18:30 ` David Miller
  2019-07-04  3:21 ` [PATCH v2 " YueHaibing
  2 siblings, 0 replies; 6+ messages in thread
From: Ilias Apalodimas @ 2019-07-03  5:12 UTC (permalink / raw)
  To: YueHaibing
  Cc: Jassi Brar, Alexei Starovoitov, David S . Miller,
	Daniel Borkmann, Jakub Kicinski, Jesper Dangaard Brouer, netdev,
	xdp-newbies, bpf, kernel-janitors

On Wed, Jul 03, 2019 at 02:42:13AM +0000, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/net/ethernet/socionext/netsec.c: In function 'netsec_clean_tx_dring':
> drivers/net/ethernet/socionext/netsec.c:637:15: warning:
>  variable 'pkts' set but not used [-Wunused-but-set-variable]
> 
> It is not used since commit ba2b232108d3 ("net: netsec: add XDP support")
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/net/ethernet/socionext/netsec.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c
> index 5544a722543f..015d1ec5436a 100644
> --- a/drivers/net/ethernet/socionext/netsec.c
> +++ b/drivers/net/ethernet/socionext/netsec.c
> @@ -634,7 +634,7 @@ static void netsec_set_rx_de(struct netsec_priv *priv,
>  static bool netsec_clean_tx_dring(struct netsec_priv *priv)
>  {
>  	struct netsec_desc_ring *dring = &priv->desc_ring[NETSEC_RING_TX];
> -	unsigned int pkts, bytes;
> +	unsigned int bytes;
>  	struct netsec_de *entry;
>  	int tail = dring->tail;
>  	int cnt = 0;
> @@ -642,7 +642,6 @@ static bool netsec_clean_tx_dring(struct netsec_priv *priv)
>  	if (dring->is_xdp)
>  		spin_lock(&dring->lock);
>  
> -	pkts = 0;
>  	bytes = 0;
>  	entry = dring->vaddr + DESC_SZ * tail;
> 
> 
> 

Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

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

* Re: [PATCH net-next] net: socionext: remove set but not used variable 'pkts'
  2019-07-03  2:42 [PATCH net-next] net: socionext: remove set but not used variable 'pkts' YueHaibing
  2019-07-03  5:12 ` Ilias Apalodimas
@ 2019-07-03 18:30 ` David Miller
  2019-07-04  3:21 ` [PATCH v2 " YueHaibing
  2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2019-07-03 18:30 UTC (permalink / raw)
  To: yuehaibing
  Cc: jaswinder.singh, ast, ilias.apalodimas, daniel, jakub.kicinski,
	hawk, netdev, xdp-newbies, bpf, kernel-janitors

From: YueHaibing <yuehaibing@huawei.com>
Date: Wed, 3 Jul 2019 02:42:13 +0000

> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/net/ethernet/socionext/netsec.c: In function 'netsec_clean_tx_dring':
> drivers/net/ethernet/socionext/netsec.c:637:15: warning:
>  variable 'pkts' set but not used [-Wunused-but-set-variable]
> 
> It is not used since commit ba2b232108d3 ("net: netsec: add XDP support")
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/net/ethernet/socionext/netsec.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c
> index 5544a722543f..015d1ec5436a 100644
> --- a/drivers/net/ethernet/socionext/netsec.c
> +++ b/drivers/net/ethernet/socionext/netsec.c
> @@ -634,7 +634,7 @@ static void netsec_set_rx_de(struct netsec_priv *priv,
>  static bool netsec_clean_tx_dring(struct netsec_priv *priv)
>  {
>  	struct netsec_desc_ring *dring = &priv->desc_ring[NETSEC_RING_TX];
> -	unsigned int pkts, bytes;
> +	unsigned int bytes;
>  	struct netsec_de *entry;
>  	int tail = dring->tail;
>  	int cnt = 0;

This breaks the reverse christmas-tree ordering of the local variables in this
function.  Please move the 'bytes' declaration down by two lines when you make
this change.

Thanks.

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

* [PATCH v2 net-next] net: socionext: remove set but not used variable 'pkts'
  2019-07-03  2:42 [PATCH net-next] net: socionext: remove set but not used variable 'pkts' YueHaibing
  2019-07-03  5:12 ` Ilias Apalodimas
  2019-07-03 18:30 ` David Miller
@ 2019-07-04  3:21 ` YueHaibing
  2019-07-04  3:37   ` [PATCH v3 " YueHaibing
  2 siblings, 1 reply; 6+ messages in thread
From: YueHaibing @ 2019-07-04  3:21 UTC (permalink / raw)
  To: Jassi Brar, Alexei Starovoitov, David S . Miller,
	Ilias Apalodimas, Daniel Borkmann, Jakub Kicinski,
	Jesper Dangaard Brouer
  Cc: YueHaibing, netdev

Cc: netdev@vger.kernel.org,
    xdp-newbies@vger.kernel.org,
    bpf@vger.kernel.org,
    kernel-janitors@vger.kernel.org

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

drivers/net/ethernet/socionext/netsec.c: In function 'netsec_clean_tx_dring':
drivers/net/ethernet/socionext/netsec.c:637:15: warning:
 variable 'pkts' set but not used [-Wunused-but-set-variable]

It is not used since commit ba2b232108d3 ("net: netsec: add XDP support")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
---
v2: keep reverse christmas-tree ordering of the local variables
---
 drivers/net/ethernet/socionext/netsec.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c
index 5544a722543f..d8d640b01119 100644
--- a/drivers/net/ethernet/socionext/netsec.c
+++ b/drivers/net/ethernet/socionext/netsec.c
@@ -634,15 +634,14 @@ static void netsec_set_rx_de(struct netsec_priv *priv,
 static bool netsec_clean_tx_dring(struct netsec_priv *priv)
 {
 	struct netsec_desc_ring *dring = &priv->desc_ring[NETSEC_RING_TX];
-	unsigned int pkts, bytes;
 	struct netsec_de *entry;
 	int tail = dring->tail;
+	unsigned int bytes;
 	int cnt = 0;
 
 	if (dring->is_xdp)
 		spin_lock(&dring->lock);
 
-	pkts = 0;
 	bytes = 0;
 	entry = dring->vaddr + DESC_SZ * tail;




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

* [PATCH v3 net-next] net: socionext: remove set but not used variable 'pkts'
  2019-07-04  3:21 ` [PATCH v2 " YueHaibing
@ 2019-07-04  3:37   ` YueHaibing
  2019-07-05 22:28     ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: YueHaibing @ 2019-07-04  3:37 UTC (permalink / raw)
  To: Jassi Brar, Alexei Starovoitov, David S . Miller,
	Ilias Apalodimas, Daniel Borkmann, Jakub Kicinski,
	Jesper Dangaard Brouer
  Cc: YueHaibing, netdev, xdp-newbies, bpf, kernel-janitors

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

drivers/net/ethernet/socionext/netsec.c: In function 'netsec_clean_tx_dring':
drivers/net/ethernet/socionext/netsec.c:637:15: warning:
 variable 'pkts' set but not used [-Wunused-but-set-variable]

It is not used since commit ba2b232108d3 ("net: netsec: add XDP support")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
---
v3: remove misplaced cc in patch log
v2: keep reverse christmas-tree ordering of the local variables
---
 drivers/net/ethernet/socionext/netsec.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c
index 5544a722543f..d8d640b01119 100644
--- a/drivers/net/ethernet/socionext/netsec.c
+++ b/drivers/net/ethernet/socionext/netsec.c
@@ -634,15 +634,14 @@ static void netsec_set_rx_de(struct netsec_priv *priv,
 static bool netsec_clean_tx_dring(struct netsec_priv *priv)
 {
 	struct netsec_desc_ring *dring = &priv->desc_ring[NETSEC_RING_TX];
-	unsigned int pkts, bytes;
 	struct netsec_de *entry;
 	int tail = dring->tail;
+	unsigned int bytes;
 	int cnt = 0;
 
 	if (dring->is_xdp)
 		spin_lock(&dring->lock);
 
-	pkts = 0;
 	bytes = 0;
 	entry = dring->vaddr + DESC_SZ * tail;




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

* Re: [PATCH v3 net-next] net: socionext: remove set but not used variable 'pkts'
  2019-07-04  3:37   ` [PATCH v3 " YueHaibing
@ 2019-07-05 22:28     ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2019-07-05 22:28 UTC (permalink / raw)
  To: yuehaibing
  Cc: jaswinder.singh, ast, ilias.apalodimas, daniel, jakub.kicinski,
	hawk, netdev, xdp-newbies, bpf, kernel-janitors

From: YueHaibing <yuehaibing@huawei.com>
Date: Thu, 4 Jul 2019 03:37:45 +0000

> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/net/ethernet/socionext/netsec.c: In function 'netsec_clean_tx_dring':
> drivers/net/ethernet/socionext/netsec.c:637:15: warning:
>  variable 'pkts' set but not used [-Wunused-but-set-variable]
> 
> It is not used since commit ba2b232108d3 ("net: netsec: add XDP support")
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

Applied to net-next.

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

end of thread, other threads:[~2019-07-05 22:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-03  2:42 [PATCH net-next] net: socionext: remove set but not used variable 'pkts' YueHaibing
2019-07-03  5:12 ` Ilias Apalodimas
2019-07-03 18:30 ` David Miller
2019-07-04  3:21 ` [PATCH v2 " YueHaibing
2019-07-04  3:37   ` [PATCH v3 " YueHaibing
2019-07-05 22:28     ` David Miller

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