From: "Kok, Auke" <auke-jan.h.kok@intel.com>
To: Julia Lawall <julia@diku.dk>
Cc: e1000-devel@lists.sourceforge.net,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [E1000-devel] [PATCH 6/8] drivers/net/igb: Use FIELD_SIZEOF
Date: Mon, 11 Feb 2008 17:15:49 +0000 [thread overview]
Message-ID: <47B082C5.5080207@intel.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0802102113480.23906@ask.diku.dk>
Julia Lawall 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.
thanks for the (3) patches, I'll make sure they get merged.
Cheers,
Auke
>
> 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>
>
> ---
>
> diff -u -p a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
> --- a/drivers/net/igb/igb_ethtool.c 2008-02-02 15:28:20.000000000 +0100
> +++ b/drivers/net/igb/igb_ethtool.c 2008-02-10 18:06:35.000000000 +0100
> @@ -43,7 +43,7 @@ struct igb_stats {
> int stat_offset;
> };
>
> -#define IGB_STAT(m) sizeof(((struct igb_adapter *)0)->m), \
> +#define IGB_STAT(m) FIELD_SIZEOF(struct igb_adapter, m), \
> offsetof(struct igb_adapter, m)
> static const struct igb_stats igb_gstrings_stats[] = {
> { "rx_packets", IGB_STAT(stats.gprc) },
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> E1000-devel mailing list
> E1000-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/e1000-devel
prev parent reply other threads:[~2008-02-11 17:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-10 20:14 [PATCH 6/8] drivers/net/igb: Use FIELD_SIZEOF Julia Lawall
2008-02-11 17:15 ` Kok, Auke [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=47B082C5.5080207@intel.com \
--to=auke-jan.h.kok@intel.com \
--cc=e1000-devel@lists.sourceforge.net \
--cc=julia@diku.dk \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).