mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-30 15:53:22 -05:00
mm: page_alloc: fix building error on -Werror=array-compare
commit ca831f29f8f25c97182e726429b38c0802200c8f upstream.
Arthur Marsh reported we would hit the error below when building kernel
with gcc-12:
CC mm/page_alloc.o
mm/page_alloc.c: In function `mem_init_print_info':
mm/page_alloc.c:8173:27: error: comparison between two arrays [-Werror=array-compare]
8173 | if (start <= pos && pos < end && size > adj) \
|
In C++20, the comparision between arrays should be warned.
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Xiongwei Song <[email protected]>
Reported-by: Arthur Marsh <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Cc: Khem Raj <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
ac94e87675
commit
bad7ed5575
1 changed files with 1 additions and 1 deletions
|
|
@ -7588,7 +7588,7 @@ void __init mem_init_print_info(const char *str)
|
|||
*/
|
||||
#define adj_init_size(start, end, size, pos, adj) \
|
||||
do { \
|
||||
if (start <= pos && pos < end && size > adj) \
|
||||
if (&start[0] <= &pos[0] && &pos[0] < &end[0] && size > adj) \
|
||||
size -= adj; \
|
||||
} while (0)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue