From: Xiu Jianfeng Date: Tue, 6 Sep 2022 07:53:12 +0000 (+0800) Subject: mm/rodata_test: use PAGE_ALIGNED() helper X-Git-Tag: v6.1-rc1~68^2~166 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=679d7f69d60bbd124542e620b745c17643cdf680;p=thirdparty%2Fkernel%2Flinux.git mm/rodata_test: use PAGE_ALIGNED() helper Use PAGE_ALIGNED() helper instead of open-coding operation, no functional changes here. Link: https://lkml.kernel.org/r/20220906075312.166595-1-xiujianfeng@huawei.com Signed-off-by: Xiu Jianfeng Signed-off-by: Andrew Morton --- diff --git a/mm/rodata_test.c b/mm/rodata_test.c index 2613371945b7e..6d783436951f3 100644 --- a/mm/rodata_test.c +++ b/mm/rodata_test.c @@ -9,13 +9,13 @@ #include #include +#include #include static const int rodata_test_data = 0xC3; void rodata_test(void) { - unsigned long start, end; int zero = 0; /* test 1: read the value */ @@ -39,13 +39,11 @@ void rodata_test(void) } /* test 4: check if the rodata section is PAGE_SIZE aligned */ - start = (unsigned long)__start_rodata; - end = (unsigned long)__end_rodata; - if (start & (PAGE_SIZE - 1)) { + if (!PAGE_ALIGNED(__start_rodata)) { pr_err("start of .rodata is not page size aligned\n"); return; } - if (end & (PAGE_SIZE - 1)) { + if (!PAGE_ALIGNED(__end_rodata)) { pr_err("end of .rodata is not page size aligned\n"); return; }