From ea6728c11f3afa15a9c7c50a6c9ae061fe5a9d00 Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Sat, 29 Mar 2008 08:21:08 +1100 Subject: [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/) // @haskernel@ @@ #include @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) // Signed-off-by: Julia Lawall Cc: Jens Axboe Cc: Benjamin Herrenschmidt Acked-by: Stephen Rothwell Signed-off-by: Andrew Morton Signed-off-by: Paul Mackerras --- drivers/block/viodasd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/block') 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"); enum { PARTITION_SHIFT = 3, MAX_DISKNO = HVMAXARCHITECTEDVIRTUALDISKS, - MAX_DISK_NAME = sizeof(((struct gendisk *)0)->disk_name) + MAX_DISK_NAME = FIELD_SIZEOF(struct gendisk, disk_name) }; static DEFINE_SPINLOCK(viodasd_spinlock); -- cgit v1.2.2