mm/mm_init.c: clean code. Use BUILD_BUG_ON when comparing compile time constant
authorMateusz Nosek <mateusznosek0@gmail.com>
Tue, 7 Apr 2020 03:08:36 +0000 (20:08 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 7 Apr 2020 17:43:41 +0000 (10:43 -0700)
MAX_ZONELISTS is a compile time constant, so it should be compared using
BUILD_BUG_ON not BUG_ON.

Signed-off-by: Mateusz Nosek <mateusznosek0@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Wei Yang <richard.weiyang@gmail.com>
Link: http://lkml.kernel.org/r/20200228224617.11343-1-mateusznosek0@gmail.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/mm_init.c

index 5c918388de993f18bb53e51af3f732b695d7e71d..7da6991d94359cebc28a55949b69802593451495 100644 (file)
@@ -37,7 +37,7 @@ void __init mminit_verify_zonelist(void)
                struct zonelist *zonelist;
                int i, listid, zoneid;
 
-               BUG_ON(MAX_ZONELISTS > 2);
+               BUILD_BUG_ON(MAX_ZONELISTS > 2);
                for (i = 0; i < MAX_ZONELISTS * MAX_NR_ZONES; i++) {
 
                        /* Identify the zone and nodelist */