public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik•org>
To: akpm@linux-foundation•org
Cc: netdev@vger•kernel.org, julia@diku•dk
Subject: Re: [patch 01/17] drivers/net/mv643xx_eth.c: Use FIELD_SIZEOF
Date: Wed, 26 Mar 2008 00:36:25 -0400	[thread overview]
Message-ID: <47E9D2C9.1010006@garzik.org> (raw)
In-Reply-To: <200803042319.m24NJK7X002654@imap1.linux-foundation.org>

akpm@linux-foundation•org wrote:
> From: Julia Lawall <julia@diku•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@diku•dk>
> Signed-off-by: Andrew Morton <akpm@linux-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@vger•kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

applied



      reply	other threads:[~2008-03-26  4:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-04 23:19 [patch 01/17] drivers/net/mv643xx_eth.c: Use FIELD_SIZEOF akpm
2008-03-26  4:36 ` Jeff Garzik [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47E9D2C9.1010006@garzik.org \
    --to=jeff@garzik$(echo .)org \
    --cc=akpm@linux-foundation$(echo .)org \
    --cc=julia@diku$(echo .)dk \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox