Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kexec: use ALIGN macro instead of open-coding it

Use ALIGN macro instead of open-coding it to improve code readability.

Link: https://lkml.kernel.org/r/20231212142706.25149-1-ytcoode@gmail.com
Signed-off-by: Yuntao Wang <ytcoode@gmail.com>
Acked-by: Baoquan He <bhe@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Yuntao Wang and committed by
Andrew Morton
db6b6fb7 e95d392d

+2 -2
+2 -2
kernel/kexec_core.c
··· 432 432 433 433 pages = NULL; 434 434 size = (1 << order) << PAGE_SHIFT; 435 - hole_start = (image->control_page + (size - 1)) & ~(size - 1); 435 + hole_start = ALIGN(image->control_page, size); 436 436 hole_end = hole_start + size - 1; 437 437 while (hole_end <= crashk_res.end) { 438 438 unsigned long i; ··· 449 449 mend = mstart + image->segment[i].memsz - 1; 450 450 if ((hole_end >= mstart) && (hole_start <= mend)) { 451 451 /* Advance the hole to the end of the segment */ 452 - hole_start = (mend + (size - 1)) & ~(size - 1); 452 + hole_start = ALIGN(mend, size); 453 453 hole_end = hole_start + size - 1; 454 454 break; 455 455 }