linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/mm_init.c: Clean code. Use BUILD_BUG_ON when comparing compile time constant
@ 2020-02-28 22:46 mateusznosek0
  2020-03-02 13:51 ` Wei Yang
  0 siblings, 1 reply; 2+ messages in thread
From: mateusznosek0 @ 2020-02-28 22:46 UTC (permalink / raw)
  To: linux-mm, linux-kernel; +Cc: Mateusz Nosek, akpm

From: Mateusz Nosek <mateusznosek0@gmail.com>

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

Signed-off-by: Mateusz Nosek <mateusznosek0@gmail.com>
---
 mm/mm_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/mm_init.c b/mm/mm_init.c
index 5c918388de99..7da6991d9435 100644
--- a/mm/mm_init.c
+++ b/mm/mm_init.c
@@ -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 */
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mm/mm_init.c: Clean code. Use BUILD_BUG_ON when comparing compile time constant
  2020-02-28 22:46 [PATCH] mm/mm_init.c: Clean code. Use BUILD_BUG_ON when comparing compile time constant mateusznosek0
@ 2020-03-02 13:51 ` Wei Yang
  0 siblings, 0 replies; 2+ messages in thread
From: Wei Yang @ 2020-03-02 13:51 UTC (permalink / raw)
  To: mateusznosek0; +Cc: linux-mm, linux-kernel, akpm

On Fri, Feb 28, 2020 at 11:46:17PM +0100, mateusznosek0@gmail.com wrote:
>From: Mateusz Nosek <mateusznosek0@gmail.com>
>
>MAX_ZONELISTS is compile time constant,
>so it should be compared using BUILD_BUG_ON not BUG_ON.
>
>Signed-off-by: Mateusz Nosek <mateusznosek0@gmail.com>

Sounds you are right.

Reviewed-by: Wei Yang <richard.weiyang@gmail.com>

>---
> mm/mm_init.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/mm/mm_init.c b/mm/mm_init.c
>index 5c918388de99..7da6991d9435 100644
>--- a/mm/mm_init.c
>+++ b/mm/mm_init.c
>@@ -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 */
>-- 
>2.17.1

-- 
Wei Yang
Help you, Help me


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-02 13:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-28 22:46 [PATCH] mm/mm_init.c: Clean code. Use BUILD_BUG_ON when comparing compile time constant mateusznosek0
2020-03-02 13:51 ` Wei Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).