[PATCH 1/3] elf, sadump: move KEXEC macros from sadump_info.c to elf_info.h

HATAYAMA Daisuke d.hatayama at jp.fujitsu.com
Sun Mar 3 23:18:29 EST 2013


Move KEXEC_CORE_NOTE_NAME and KEXEC_CORE_NOTE_NAME_BYTES in elf_info.h
to export them in elf_info.c. Later patch refers to them when reading
PT_NOTE program header entries.

During this change, round-up operations are dropped to make it uniform
to other macros such as VMCOREINFO_NOTE_NAME that is similarly
exported from elf_info.h.

Instead, the roundup-operations dropped are moved into
KEXEC_NOTE_BYTES.

Signed-off-by: HATAYAMA Daisuke <d.hatayama at jp.fujitsu.com>
---

 elf_info.h    |    3 +++
 sadump_info.c |    4 +---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/elf_info.h b/elf_info.h
index 3b430dd..eb58023 100644
--- a/elf_info.h
+++ b/elf_info.h
@@ -19,6 +19,9 @@
 #include <elf.h>
 #include <sys/types.h>
 
+#define KEXEC_CORE_NOTE_NAME "CORE"
+#define KEXEC_CORE_NOTE_NAME_BYTES sizeof(KEXEC_CORE_NOTE_NAME)
+
 #define ERASEINFO_NOTE_NAME		"ERASEINFO"
 #define ERASEINFO_NOTE_NAME_BYTES	(sizeof(ERASEINFO_NOTE_NAME))
 
diff --git a/sadump_info.c b/sadump_info.c
index 9346bf1..be6cf55 100644
--- a/sadump_info.c
+++ b/sadump_info.c
@@ -37,12 +37,10 @@
 
 #endif
 
-#define KEXEC_CORE_NOTE_NAME "CORE"
-#define KEXEC_CORE_NOTE_NAME_BYTES roundup(sizeof(KEXEC_CORE_NOTE_NAME), 4)
 #define KEXEC_CORE_NOTE_DESC_BYTES roundup(sizeof(struct elf_prstatus), 4)
 
 #define KEXEC_NOTE_BYTES ((KEXEC_NOTE_HEAD_BYTES * 2) +                \
-			  KEXEC_CORE_NOTE_NAME_BYTES +		       \
+			  roundup(KEXEC_CORE_NOTE_NAME_BYTES, 4) +     \
 			  KEXEC_CORE_NOTE_DESC_BYTES )
 
 #define for_each_online_cpu(cpu)					\




More information about the kexec mailing list