vmcoreinfo: use the existing offsetof() for VMCOREINFO_OFFSET()
[linux-2.6.git] / include / linux / kexec.h
index 39112a0e4693de7c9f8f58872bfc42b821b3f2ab..cbc3cd7e11c12ab43935bb9928fff99fcf143719 100644 (file)
@@ -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)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) \
 #define VMCOREINFO_LENGTH(name, value) \
        vmcoreinfo_append_str("LENGTH(%s)=%lu\n", #name, (unsigned long)value)
 #define VMCOREINFO_NUMBER(name) \