]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[POWERPC] Use FIELD_SIZEOF in arch/ppc
authorJulia Lawall <julia@diku.dk>
Sun, 10 Feb 2008 20:07:59 +0000 (07:07 +1100)
committerPaul Mackerras <paulus@samba.org>
Tue, 26 Feb 2008 11:17:03 +0000 (22:17 +1100)
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: Paul Mackerras <paulus@samba.org>
arch/ppc/8xx_io/commproc.c

index 9d656de0f0f19357d7f48724743bb6945ef7ba93..752443df5ecf270ea67ca0e3c44dafd22d62a678 100644 (file)
@@ -43,7 +43,7 @@
 ({                                                                     \
        u32 offset = offsetof(immap_t, member);                         \
        void *addr = ioremap (IMAP_ADDR + offset,                       \
-                             sizeof( ((immap_t*)0)->member));          \
+                             FIELD_SIZEOF(immap_t, member));           \
        addr;                                                           \
 })