Skip to contentSkip to conversation

enic: fix pci_alloc_consistent argument

PATCH In review Randy Dunlap 3 participants 3 messages Jun 8, 2010 – Jun 12, 2010

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

PATCH 1/1 enic: fix pci_alloc_consistent argument

From: Randy Dunlap <[email protected]>

Fix build warning on i386 (32-bit) with 32-bit dma_addr_t:

drivers/net/enic/vnic_dev.c: In function 'vnic_dev_init_prov':
drivers/net/enic/vnic_dev.c:716: warning: passing argument 3 of 'pci_alloc_consistent' from incompatible pointer type include/asm-generic/pci-dma-compat.h:16: note: expected 'dma_addr_t *' but argument is of type 'u64 *'

Now builds without warnings on i386 and on x86_64.

Cc Scott Feldman <[email protected]>
Cc Vasanthy Kolluri <[email protected]>
Cc Roopa Prabhu <[email protected]>
---
 drivers/net/enic/vnic_dev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/enic/vnic_dev.c +1 -1
@@ -709,7 +709,7 @@ int vnic_dev_init_prov(struct vnic_dev *
 {
 	u64 a0, a1 = len;
 	int wait = 1000;
-	u64 prov_pa;
+	dma_addr_t prov_pa;
 	void *prov_buf;
 	int ret;
 

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

Fix build warning on i386 (32-bit) with 32-bit dma_addr_t:

drivers/net/enic/vnic_dev.c: In function 'vnic_dev_init_prov':
drivers/net/enic/vnic_dev.c:716: warning: passing argument 3 of 'pci_alloc_consistent' from incompatible pointer type include/asm-generic/pci-dma-compat.h:16: note: expected 'dma_addr_t *' but argument is of type 'u64 *'

Now builds without warnings on i386 and on x86_64.

Quoted 7 lines
Cc Scott Feldman <[email protected]>
Cc Vasanthy Kolluri <[email protected]>
Cc Roopa Prabhu <[email protected]>
---
 drivers/net/enic/vnic_dev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
maintainer
#2 lore raw

From: Scott Feldman <[email protected]>
Date: Tue, 08 Jun 2010 14:55:27 -0700

Quoted 22 lines · Randy Dunlap
Quoted 13 lines

From: Randy Dunlap <[email protected]>

Fix build warning on i386 (32-bit) with 32-bit dma_addr_t:

drivers/net/enic/vnic_dev.c: In function 'vnic_dev_init_prov':
drivers/net/enic/vnic_dev.c:716: warning: passing argument 3 of 'pci_alloc_consistent' from incompatible pointer type include/asm-generic/pci-dma-compat.h:16: note: expected 'dma_addr_t *' but argument is of type 'u64 *'

Now builds without warnings on i386 and on x86_64.

Quoted 7 lines
Cc Scott Feldman <[email protected]>
Cc Vasanthy Kolluri <[email protected]>
Cc Roopa Prabhu <[email protected]>
---
 drivers/net/enic/vnic_dev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 1 line

I'm applying this to net-2.6 since it's also a bug fix, as passing a u64 pointer in here will make pci_alloc_consistent() write garbage since it expects a dma_addr_t there which as on i386 could be 32-bit.