From 7a6d84c1b26fd8a1deb28a4bbed672959f7f26ae Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Tue, 4 Mar 2008 15:19:19 -0800 Subject: [PATCH] drivers/net/mv643xx_eth.c: Use FIELD_SIZEOF 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/) // @haskernel@ @@ #include @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) // Signed-off-by: Julia Lawall Signed-off-by: Andrew Morton Signed-off-by: Jeff Garzik --- drivers/net/mv643xx_eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 771139e283a..d65cadef4d2 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c @@ -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[] = { -- 2.41.0