diff options
author | Julia Lawall <julia@diku.dk> | 2008-03-28 17:21:08 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-04-01 05:43:10 -0400 |
commit | ea6728c11f3afa15a9c7c50a6c9ae061fe5a9d00 (patch) | |
tree | 779deb5e7f8495174919fabaa86ed54f5b1fc979 | |
parent | 1d18a602e9116dc89da6750dcbda44bb1eb82b8e (diff) |
[POWERPC] Use FIELD_SIZEOF in drivers/block/viodasd.c
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>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | drivers/block/viodasd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c index 41ca721d2523..ebfe038d859e 100644 --- a/drivers/block/viodasd.c +++ b/drivers/block/viodasd.c | |||
@@ -69,7 +69,7 @@ MODULE_LICENSE("GPL"); | |||
69 | enum { | 69 | enum { |
70 | PARTITION_SHIFT = 3, | 70 | PARTITION_SHIFT = 3, |
71 | MAX_DISKNO = HVMAXARCHITECTEDVIRTUALDISKS, | 71 | MAX_DISKNO = HVMAXARCHITECTEDVIRTUALDISKS, |
72 | MAX_DISK_NAME = sizeof(((struct gendisk *)0)->disk_name) | 72 | MAX_DISK_NAME = FIELD_SIZEOF(struct gendisk, disk_name) |
73 | }; | 73 | }; |
74 | 74 | ||
75 | static DEFINE_SPINLOCK(viodasd_spinlock); | 75 | static DEFINE_SPINLOCK(viodasd_spinlock); |