From: Ken'ichi Ohmichi Date: Thu, 7 Feb 2008 08:15:22 +0000 (-0800) Subject: vmcoreinfo: use the existing offsetof() for VMCOREINFO_OFFSET() X-Git-Tag: v2.6.25-rc1~394 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=1e4f2955433231b4b02dc4a9eb5d4d403a8680e1;p=linux-2.6-omap-h63xx.git vmcoreinfo: use the existing offsetof() for VMCOREINFO_OFFSET() It is better that the existing offsetof() is used for VMCOREINFO_OFFSET(). This discussion is the following: http://www.ussg.iu.edu/hypermail/linux/kernel/0709.3/0584.html Signed-off-by: Ken'ichi Ohmichi Acked-by: Simon Horman Cc: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/kexec.h b/include/linux/kexec.h index 39112a0e469..cbc3cd7e11c 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h @@ -137,7 +137,7 @@ unsigned long paddr_vmcoreinfo_note(void); (unsigned long)sizeof(struct name)) #define VMCOREINFO_OFFSET(name, field) \ vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #field, \ - (unsigned long)&(((struct name *)0)->field)) + (unsigned long)offsetof(struct name, field)) #define VMCOREINFO_LENGTH(name, value) \ vmcoreinfo_append_str("LENGTH(%s)=%lu\n", #name, (unsigned long)value) #define VMCOREINFO_NUMBER(name) \