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

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