netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 1/3] gianfar: Remove 'maybe-uninitialized' compile warning
@ 2013-03-21 13:12 Claudiu Manoil
  2013-03-21 13:12 ` [PATCH net-next 2/3] gianfar: Cleanup dead code and minor formatting Claudiu Manoil
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Claudiu Manoil @ 2013-03-21 13:12 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller

Warning message:
warning: 'budget_per_q' may be used uninitialized in this function

budget_per_q won't be used uninitialized since the only time
it doesn't get initialized is when entering gfar_poll with
num_act_queues == 0, meaning rstat_rxf == 0, in which case
budget_per_q is not utilized (as it has no meaning).
Inititalize budget_per_q to 0 though to suppress this compile
warning.

Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
---
(Sorry I didn't notice this (unexpected) warning before submitting
the patches that introduced 'budget_per_q'.)

 drivers/net/ethernet/freescale/gianfar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index 49ce83b..37fbf67 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -2838,7 +2838,7 @@ static int gfar_poll(struct napi_struct *napi, int budget)
 	struct gfar_priv_tx_q *tx_queue = NULL;
 	struct gfar_priv_rx_q *rx_queue = NULL;
 	int work_done = 0, work_done_per_q = 0;
-	int i, budget_per_q;
+	int i, budget_per_q = 0;
 	int has_tx_work;
 	unsigned long rstat_rxf;
 	int num_act_queues;
-- 
1.7.11.3

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

* [PATCH net-next 2/3] gianfar: Cleanup dead code and minor formatting
  2013-03-21 13:12 [PATCH net-next 1/3] gianfar: Remove 'maybe-uninitialized' compile warning Claudiu Manoil
@ 2013-03-21 13:12 ` Claudiu Manoil
  2013-03-21 16:02   ` David Miller
  2013-03-21 13:12 ` [PATCH net-next 3/3] gianfar: Remove superfluous kernel_dropped local counter Claudiu Manoil
  2013-03-21 16:02 ` [PATCH net-next 1/3] gianfar: Remove 'maybe-uninitialized' compile warning David Miller
  2 siblings, 1 reply; 6+ messages in thread
From: Claudiu Manoil @ 2013-03-21 13:12 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller

Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
---
 drivers/net/ethernet/freescale/gianfar.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index 37fbf67..434b31b 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -690,7 +690,7 @@ static int gfar_of_init(struct platform_device *ofdev, struct net_device **pdev)
 	}
 
 	for (i = 0; i < priv->num_tx_queues; i++)
-	       priv->tx_queue[i] = NULL;
+		priv->tx_queue[i] = NULL;
 	for (i = 0; i < priv->num_rx_queues; i++)
 		priv->rx_queue[i] = NULL;
 
@@ -1824,6 +1824,7 @@ static void gfar_configure_coalescing(struct gfar_private *priv,
 
 	if (priv->mode == MQ_MG_MODE) {
 		int i = 0;
+
 		baddr = &regs->txic0;
 		for_each_set_bit(i, &tx_mask, priv->num_tx_queues) {
 			gfar_write(baddr + i, 0);
@@ -1838,7 +1839,7 @@ static void gfar_configure_coalescing(struct gfar_private *priv,
 				gfar_write(baddr + i, priv->rx_queue[i]->rxic);
 		}
 	} else {
-		/* Backward compatible case ---- even if we enable
+		/* Backward compatible case -- even if we enable
 		 * multiple queues, there's only single reg to program
 		 */
 		gfar_write(&regs->txic, 0);
@@ -2478,7 +2479,6 @@ static void gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
 	struct net_device *dev = tx_queue->dev;
 	struct netdev_queue *txq;
 	struct gfar_private *priv = netdev_priv(dev);
-	struct gfar_priv_rx_q *rx_queue = NULL;
 	struct txbd8 *bdp, *next = NULL;
 	struct txbd8 *lbdp = NULL;
 	struct txbd8 *base = tx_queue->tx_bd_base;
@@ -2493,7 +2493,6 @@ static void gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
 	u32 lstatus;
 	size_t buflen;
 
-	rx_queue = priv->rx_queue[tqi];
 	txq = netdev_get_tx_queue(dev, tqi);
 	bdp = tx_queue->dirty_tx;
 	skb_dirtytx = tx_queue->skb_dirtytx;
-- 
1.7.11.3

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

* [PATCH net-next 3/3] gianfar: Remove superfluous kernel_dropped local counter
  2013-03-21 13:12 [PATCH net-next 1/3] gianfar: Remove 'maybe-uninitialized' compile warning Claudiu Manoil
  2013-03-21 13:12 ` [PATCH net-next 2/3] gianfar: Cleanup dead code and minor formatting Claudiu Manoil
@ 2013-03-21 13:12 ` Claudiu Manoil
  2013-03-21 16:02   ` David Miller
  2013-03-21 16:02 ` [PATCH net-next 1/3] gianfar: Remove 'maybe-uninitialized' compile warning David Miller
  2 siblings, 1 reply; 6+ messages in thread
From: Claudiu Manoil @ 2013-03-21 13:12 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller

The GRO_DROP return code is handled by the core network layer.
The current kernel approach is to factorize this kind of statistics into
the upper layers, instead of having all the drivers maintaining them.

Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
---
 drivers/net/ethernet/freescale/gianfar.c         | 6 +-----
 drivers/net/ethernet/freescale/gianfar.h         | 1 -
 drivers/net/ethernet/freescale/gianfar_ethtool.c | 1 -
 3 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index 434b31b..96fbe35 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -2695,8 +2695,6 @@ static void gfar_process_frame(struct net_device *dev, struct sk_buff *skb,
 	struct gfar_private *priv = netdev_priv(dev);
 	struct rxfcb *fcb = NULL;
 
-	gro_result_t ret;
-
 	/* fcb is at the beginning if exists */
 	fcb = (struct rxfcb *)skb->data;
 
@@ -2735,10 +2733,8 @@ static void gfar_process_frame(struct net_device *dev, struct sk_buff *skb,
 		__vlan_hwaccel_put_tag(skb, fcb->vlctl);
 
 	/* Send the packet up the stack */
-	ret = napi_gro_receive(napi, skb);
+	napi_gro_receive(napi, skb);
 
-	if (unlikely(GRO_DROP == ret))
-		atomic64_inc(&priv->extra_stats.kernel_dropped);
 }
 
 /* gfar_clean_rx_ring() -- Processes each frame in the rx ring
diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h
index eec87ea..04b552c 100644
--- a/drivers/net/ethernet/freescale/gianfar.h
+++ b/drivers/net/ethernet/freescale/gianfar.h
@@ -629,7 +629,6 @@ struct rmon_mib
 };
 
 struct gfar_extra_stats {
-	atomic64_t kernel_dropped;
 	atomic64_t rx_large;
 	atomic64_t rx_short;
 	atomic64_t rx_nonoctet;
diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c
index 8248df7..4e7118f 100644
--- a/drivers/net/ethernet/freescale/gianfar_ethtool.c
+++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c
@@ -66,7 +66,6 @@ static void gfar_gdrvinfo(struct net_device *dev,
 			  struct ethtool_drvinfo *drvinfo);
 
 static const char stat_gstrings[][ETH_GSTRING_LEN] = {
-	"rx-dropped-by-kernel",
 	"rx-large-frame-errors",
 	"rx-short-frame-errors",
 	"rx-non-octet-errors",
-- 
1.7.11.3

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

* Re: [PATCH net-next 1/3] gianfar: Remove 'maybe-uninitialized' compile warning
  2013-03-21 13:12 [PATCH net-next 1/3] gianfar: Remove 'maybe-uninitialized' compile warning Claudiu Manoil
  2013-03-21 13:12 ` [PATCH net-next 2/3] gianfar: Cleanup dead code and minor formatting Claudiu Manoil
  2013-03-21 13:12 ` [PATCH net-next 3/3] gianfar: Remove superfluous kernel_dropped local counter Claudiu Manoil
@ 2013-03-21 16:02 ` David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2013-03-21 16:02 UTC (permalink / raw)
  To: claudiu.manoil; +Cc: netdev

From: Claudiu Manoil <claudiu.manoil@freescale.com>
Date: Thu, 21 Mar 2013 15:12:13 +0200

> Warning message:
> warning: 'budget_per_q' may be used uninitialized in this function
> 
> budget_per_q won't be used uninitialized since the only time
> it doesn't get initialized is when entering gfar_poll with
> num_act_queues == 0, meaning rstat_rxf == 0, in which case
> budget_per_q is not utilized (as it has no meaning).
> Inititalize budget_per_q to 0 though to suppress this compile
> warning.
> 
> Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>

Applied.

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

* Re: [PATCH net-next 2/3] gianfar: Cleanup dead code and minor formatting
  2013-03-21 13:12 ` [PATCH net-next 2/3] gianfar: Cleanup dead code and minor formatting Claudiu Manoil
@ 2013-03-21 16:02   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2013-03-21 16:02 UTC (permalink / raw)
  To: claudiu.manoil; +Cc: netdev

From: Claudiu Manoil <claudiu.manoil@freescale.com>
Date: Thu, 21 Mar 2013 15:12:14 +0200

> Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>

Applied.

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

* Re: [PATCH net-next 3/3] gianfar: Remove superfluous kernel_dropped local counter
  2013-03-21 13:12 ` [PATCH net-next 3/3] gianfar: Remove superfluous kernel_dropped local counter Claudiu Manoil
@ 2013-03-21 16:02   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2013-03-21 16:02 UTC (permalink / raw)
  To: claudiu.manoil; +Cc: netdev

From: Claudiu Manoil <claudiu.manoil@freescale.com>
Date: Thu, 21 Mar 2013 15:12:15 +0200

> The GRO_DROP return code is handled by the core network layer.
> The current kernel approach is to factorize this kind of statistics into
> the upper layers, instead of having all the drivers maintaining them.
> 
> Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>

Applied.

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

end of thread, other threads:[~2013-03-21 16:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-21 13:12 [PATCH net-next 1/3] gianfar: Remove 'maybe-uninitialized' compile warning Claudiu Manoil
2013-03-21 13:12 ` [PATCH net-next 2/3] gianfar: Cleanup dead code and minor formatting Claudiu Manoil
2013-03-21 16:02   ` David Miller
2013-03-21 13:12 ` [PATCH net-next 3/3] gianfar: Remove superfluous kernel_dropped local counter Claudiu Manoil
2013-03-21 16:02   ` David Miller
2013-03-21 16:02 ` [PATCH net-next 1/3] gianfar: Remove 'maybe-uninitialized' compile warning 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).