Skip to contentSkip to conversation

gianfar: fix compile warning

PATCH New Grant Likely 1 participant 1 message Oct 18, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gianfar: fix compile warning

From: Grant Likely <[email protected]>

Eliminate an uninitialized variable warning. The code is correct, but a pointer to the automatic variable 'addr' is passed to dma_alloc_coherent. Since addr has never been initialized, and the compiler doesn't know what dma_alloc_coherent will do with it, it complains.

---

 drivers/net/gianfar.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/gianfar.c +1 -1
index cc288d8..c009ab6 100644
@@ -696,7 +696,7 @@ int startup_gfar(struct net_device *dev)
 {
 	struct txbd8 *txbdp;
 	struct rxbd8 *rxbdp;
-	dma_addr_t addr;
+	dma_addr_t addr = 0;
 	unsigned long vaddr;
 	int i;
 	struct gfar_private *priv = netdev_priv(dev);