]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
drivers/net/mv643xx_eth.c: Use FIELD_SIZEOF
authorJulia Lawall <julia@diku.dk>
Tue, 4 Mar 2008 23:19:19 +0000 (15:19 -0800)
committerJeff Garzik <jeff@garzik.org>
Wed, 26 Mar 2008 04:19:41 +0000 (00:19 -0400)
Robert P.J. Day proposed to use the macro FIELD_SIZEOF in replace of code
that matches its definition.

The modification was made using the following semantic patch
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@haskernel@
@@

#include <linux/kernel.h>

@depends on haskernel@
type t;
identifier f;
@@

- (sizeof(((t*)0)->f))
+ FIELD_SIZEOF(t, f)

@depends on haskernel@
type t;
identifier f;
@@

- sizeof(((t*)0)->f)
+ FIELD_SIZEOF(t, f)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/mv643xx_eth.c

index 771139e283af3609b3ae1b0e46b989ec6ea1a9be..d65cadef4d22a4890a76cf4843bd81046d349622 100644 (file)
@@ -3156,7 +3156,7 @@ struct mv643xx_stats {
        int stat_offset;
 };
 
-#define MV643XX_STAT(m) sizeof(((struct mv643xx_private *)0)->m), \
+#define MV643XX_STAT(m) FIELD_SIZEOF(struct mv643xx_private, m), \
                                        offsetof(struct mv643xx_private, m)
 
 static const struct mv643xx_stats mv643xx_gstrings_stats[] = {