From: Julia Lawall Date: Fri, 28 Mar 2008 21:21:08 +0000 (+1100) Subject: [POWERPC] Use FIELD_SIZEOF in drivers/block/viodasd.c X-Git-Tag: v2.6.26-rc1~1125^2~88 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea6728c11f3afa15a9c7c50a6c9ae061fe5a9d00;p=linux-2.6 [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 --- diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c index 41ca721d25..ebfe038d85 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);