[PATCH 13/13] kexec: x86_64: use _ALIGN* to make the logic clear

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Zhang Yanfei <zhangyanfei@xxxxxxxxxxxxxx>

By replacing all the explicit align opertion with marco _ALIGN*,
the code logic could be more clear.

Signed-off-by: Zhang Yanfei <zhangyanfei at cn.fujitsu.com>
---
 kexec/arch/x86_64/kexec-bzImage64.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kexec/arch/x86_64/kexec-bzImage64.c b/kexec/arch/x86_64/kexec-bzImage64.c
index 1496573..86e6d13 100644
--- a/kexec/arch/x86_64/kexec-bzImage64.c
+++ b/kexec/arch/x86_64/kexec-bzImage64.c
@@ -197,7 +197,7 @@ static int do_bzImage64_load(struct kexec_info *info,
 	k_size = kernel_len - kern16_size;
 	/* need to use run-time size for buffer searching */
 	dbgprintf("kernel init_size 0x%x\n", real_mode->init_size);
-	size = (real_mode->init_size + (4096 - 1)) & ~(4096 - 1);
+	size = _ALIGN(real_mode->init_size, 4096);
 	align = real_mode->kernel_alignment;
 	addr = add_buffer(info, kernel + kern16_size, k_size,
 			  size, align, 0x100000, -1, -1);
-- 
1.7.1




[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux