lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 11 Feb 2008 09:15:49 -0800
From:	"Kok, Auke" <auke-jan.h.kok@...el.com>
To:	Julia Lawall <julia@...u.dk>
CC:	e1000-devel@...ts.sourceforge.net, kernel-janitors@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [E1000-devel] [PATCH 6/8] drivers/net/igb: Use FIELD_SIZEOF

Julia Lawall 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.


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@...u.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@...ts.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/e1000-devel

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ