[PATCH 6/4] [-mm patch] use the existing offsetof().

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>
Cc: Adrian Bunk <bunk@...>, kexec-ml <kexec@...>, lkml <linux-kernel@...>, David Rientjes <rientjes@...>, Joe Perches <joe@...>
Date: Thursday, September 20, 2007 - 1:32 am

[PATCH 6/4] [-mm patch] use the existing offsetof().
 It is better that offsetof() is used for VMCOREINFO_OFFSET().
 This idea is Joe Perches's.



Thanks
Ken'ichi Ohmichi 

---
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
---
diff -rpuN a/include/linux/kexec.h b/include/linux/kexec.h
--- a/include/linux/kexec.h	2007-09-18 15:23:22.000000000 +0900
+++ b/include/linux/kexec.h	2007-09-18 15:27:29.000000000 +0900
@@ -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) \
_

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/4] [-mm patch] Cleanup add-vmcoreinfo.patch v2, Ken'ichi Ohmichi, (Thu Sep 13, 10:49 pm)
[PATCH 4/4] [-mm patch] Add a prefix "VMCOREINFO_" to the v..., Ken'ichi Ohmichi, (Thu Sep 13, 11:00 pm)
[PATCH 6/4] [-mm patch] use the existing offsetof()., Ken'ichi Ohmichi, (Thu Sep 20, 1:32 am)
Re: [PATCH 6/4] [-mm patch] use the existing offsetof()., Satyam Sharma, (Thu Sep 20, 8:28 am)
Re: [PATCH 6/4] [-mm patch] use the existing offsetof()., Ken'ichi Ohmichi, (Tue Sep 25, 4:50 am)
[PATCH 5/4] [-mm patch] Rename macros returning the size., Ken'ichi Ohmichi, (Thu Sep 20, 1:30 am)
Re: [PATCH 5/4] [-mm patch] Rename macros returning the size., Ken'ichi Ohmichi, (Tue Sep 25, 4:49 am)
[PATCH 3/4] [-mm patch] Use the existing ia64_tpa() instead..., Ken'ichi Ohmichi, (Thu Sep 13, 10:58 pm)
[PATCH 2/4] [-mm patch] Add nodemask_t's size and NR_FREE_P..., Ken'ichi Ohmichi, (Thu Sep 13, 10:56 pm)
[PATCH 1/4] [-mm patch] Cleanup the coding style according ..., Ken'ichi Ohmichi, (Thu Sep 13, 10:53 pm)