[PATCH 02/13] kexec: use _ALIGN() instead of align()

Zhang Yanfei zhangyanfei.yes at gmail.com
Wed Mar 13 13:21:43 EDT 2013


From: Zhang Yanfei <zhangyanfei at cn.fujitsu.com>

Since we have imported macro _ALIGN() for global use, replace the call
of function align() with _ALIGN() and remove align().

Signed-off-by: Zhang Yanfei <zhangyanfei at cn.fujitsu.com>
---
 kexec/kexec-elf-boot.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/kexec/kexec-elf-boot.c b/kexec/kexec-elf-boot.c
index 9a160bb..f082f8b 100644
--- a/kexec/kexec-elf-boot.c
+++ b/kexec/kexec-elf-boot.c
@@ -67,12 +67,6 @@ static struct boot_notes {
 	},
 };
 
-static inline unsigned long align(unsigned long val, unsigned long align)
-{
-	return (val + align - 1) & ~(align - 1);
-
-}
-
 unsigned long elf_boot_notes(
 	struct kexec_info *info, unsigned long max_addr,
 	const char *cmdline, int cmdline_len)
@@ -80,7 +74,7 @@ unsigned long elf_boot_notes(
 	unsigned long note_bytes;
 	unsigned long note_base;
 	struct boot_notes *notes;
-	note_bytes = sizeof(*notes) + align(cmdline_len, 4);
+	note_bytes = sizeof(*notes) + _ALIGN(cmdline_len, 4);
 	notes = xmalloc(note_bytes);
 	memcpy(notes, &boot_notes, sizeof(boot_notes));
 	memcpy(notes->command_line, cmdline, cmdline_len);
-- 
1.7.1




More information about the kexec mailing list