[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <47E9D2C9.1010006@garzik.org>
Date: Wed, 26 Mar 2008 00:36:25 -0400
From: Jeff Garzik <jeff@...zik.org>
To: akpm@...ux-foundation.org
CC: netdev@...r.kernel.org, julia@...u.dk
Subject: Re: [patch 01/17] drivers/net/mv643xx_eth.c: Use FIELD_SIZEOF
akpm@...ux-foundation.org wrote:
> From: Julia Lawall <julia@...u.dk>
>
> 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@...u.dk>
> Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
> ---
>
> drivers/net/mv643xx_eth.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff -puN drivers/net/mv643xx_eth.c~drivers-net-mv643xx_ethc-use-field_sizeof drivers/net/mv643xx_eth.c
> --- a/drivers/net/mv643xx_eth.c~drivers-net-mv643xx_ethc-use-field_sizeof
> +++ a/drivers/net/mv643xx_eth.c
> @@ -3155,7 +3155,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[] = {
> _
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
applied
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists