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  PHC 
Open Source and information security mailing list archives
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:	Sun, 10 Feb 2008 21:13:11 +0100 (CET)
From:	Julia Lawall <>
Subject: [PATCH 5/8] drivers/net/mv643xx_eth.c: Use FIELD_SIZEOF

From: Julia Lawall <>

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

// <smpl>

#include <linux/kernel.h>

@depends on haskernel@
type t;
identifier f;

- (sizeof(((t*)0)->f))

@depends on haskernel@
type t;
identifier f;

- sizeof(((t*)0)->f)
// </smpl>

Signed-off-by: Julia Lawall <>


diff -u -p a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
--- a/drivers/net/mv643xx_eth.c 2008-02-08 08:58:12.000000000 +0100
+++ b/drivers/net/mv643xx_eth.c 2008-02-10 18:00:09.000000000 +0100
@@ -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
More majordomo info at

Powered by blists - more mailing lists