From 5e32ba902307f615490c610ab85b012f3df063d9 Mon Sep 17 00:00:00 2001 From: Kalesh Singh Date: Thu, 21 Mar 2024 13:11:13 -0700 Subject: [PATCH] ANDROID: 16K: Remove unescessary err log in randomize_page() Since __PAGE_ALIGNED(x) automatically logs any parameter that is not aligned, in the case of randomize_page() it incorrectly emits an error log. The check in randomize_page() is to determine whether alignment should be done on the start addr: if (!__PAGE_ALIGNED(start)) { range -= __PAGE_ALIGN(start) - start; start = __PAGE_ALIGN(start); } Use __offset_in_page() instead of !__PAGE_ALIGNED() since this doesn't emit a log. Bug: 383389337 Bug: 330751658 Bug: 302403436 Bug: 315325080 Change-Id: I26bfde32bbc9df4c5b6c9ec0cc21b66657ebbb7a Signed-off-by: Kalesh Singh --- mm/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/util.c b/mm/util.c index 9ba047da4459..2bb3e52845e4 100644 --- a/mm/util.c +++ b/mm/util.c @@ -386,7 +386,7 @@ unsigned long randomize_stack_top(unsigned long stack_top) */ unsigned long randomize_page(unsigned long start, unsigned long range) { - if (!__PAGE_ALIGNED(start)) { + if (__offset_in_page(start)) { range -= __PAGE_ALIGN(start) - start; start = __PAGE_ALIGN(start); }