Re: [PATCH] LIB82596: correct data types for hardware addresses

From
Jeff Garzik <hidden>
Date
2007-12-01 21:43:06
Reply to
Thomas Bogendoerfer, 2007-11-30
Thomas Bogendoerfer wrote:
quoted hunk ↗ jump to hunk
dma_addr_t is 64bit wide on some architectures (for example 64bit MIPS),
so it's not a good idea to use it for 32bit wide addresses in descriptors.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
---

 drivers/net/lib82596.c |   50 ++++++++++++++++++++++++------------------------
 1 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/drivers/net/lib82596.c b/drivers/net/lib82596.c
index 9a855e5..b59f442 100644
--- a/drivers/net/lib82596.c
+++ b/drivers/net/lib82596.c
@@ -176,8 +176,8 @@ struct i596_reg {
 struct i596_tbd {
 	unsigned short size;
 	unsigned short pad;
-	dma_addr_t     next;
-	dma_addr_t     data;
+	u32            next;
+	u32            data;
 	u32 cache_pad[5];		/* Total 32 bytes... */
 };
applied, though its incomplete for today's drivers.  I recommend converting those data types to the "sparse" data types that indicate endian-ness (see __le32, etc.).  Then verify that the code passes all sparse checks.

See Documentation/sparse.txt for more info.

Also, make sure it passes scripts/checkpatch.pl checks too, while you're at it...

Thanks,

	Jeff


Thread (2 messages) 2 messages, 2 authors, last reply 2007-12-01
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help