Skip to content

Commit

Permalink
mm/mm_init.c: clean code. Use BUILD_BUG_ON when comparing compile tim…
Browse files Browse the repository at this point in the history
…e constant

MAX_ZONELISTS is a compile time constant, so it should be compared using
BUILD_BUG_ON not BUG_ON.

Signed-off-by: Mateusz Nosek <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Reviewed-by: Wei Yang <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Mateusz Nosek authored and torvalds committed Apr 7, 2020
1 parent 552657b commit e46b893
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/mm_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit e46b893

Please sign in to comment.