Skip to contentSkip to conversation

gianfar: fix compile warning

PATCH In review Grant Likely 2 participants 2 messages Dec 2, 2007 – Dec 4, 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.

---

Jeff, this one should go in for 2.6.24

Cheers,
g.

 drivers/net/gianfar.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/gianfar.c +1 -1
index 38268d7..0431e9e 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);
#1 lore raw
Quoted 11 lines · Grant Likely

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.

---

Jeff, this one should go in for 2.6.24

applied #upstream-fixes