Skip to contentSkip to conversation

mm: skip less than check for MAX_NR_ZONES

PATCH In review [email protected] 3 participants 3 messages Aug 19, 2024 – Aug 20, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mm: skip less than check for MAX_NR_ZONES

From: Alex Shi <[email protected]>

Remove unnecessary '<' check for ZONES_SHIFT assignment.

---
 include/linux/page-flags-layout.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/page-flags-layout.h +1 -1
index 7d79818dc065..7edc2b8a3414 100644
@@ -14,7 +14,7 @@
  */
 #if MAX_NR_ZONES < 2
 #define ZONES_SHIFT 0
-#elif MAX_NR_ZONES <= 2
+#elif MAX_NR_ZONES == 2
 #define ZONES_SHIFT 1
 #elif MAX_NR_ZONES <= 4
 #define ZONES_SHIFT 2
Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 9 lines · On Mon, 19 Aug 2024 19:26:28 +0800 [email protected] wrote:

From: Alex Shi <[email protected]>

Remove unnecessary '<' check for ZONES_SHIFT assignment.

...

include/linux/page-flags-layout.h line 20

Quoted 8 lines
include/linux/page-flags-layout.h +1 -1
@@ -14,7 +14,7 @@
  */
 #if MAX_NR_ZONES < 2
 #define ZONES_SHIFT 0
-#elif MAX_NR_ZONES <= 2
+#elif MAX_NR_ZONES == 2
 #define ZONES_SHIFT 1
 #elif MAX_NR_ZONES <= 4
 #define ZONES_SHIFT 2

mmm, why. I think it looks more logical (and certainly more consistent) the way things are now.

#2 lore raw
Quoted 8 lines · Andrew Morton
Quoted 6 lines · On Mon, 19 Aug 2024 19:26:28 +0800 [email protected] wrote:

From: Alex Shi <[email protected]>

Remove unnecessary '<' check for ZONES_SHIFT assignment.

...

Quoted 15 lines

include/linux/page-flags-layout.h line 20

Quoted 11 lines
include/linux/page-flags-layout.h +1 -1
@@ -14,7 +14,7 @@
  */
 #if MAX_NR_ZONES < 2
 #define ZONES_SHIFT 0
-#elif MAX_NR_ZONES <= 2
+#elif MAX_NR_ZONES == 2
 #define ZONES_SHIFT 1
 #elif MAX_NR_ZONES <= 4
 #define ZONES_SHIFT 2

mmm, why. I think it looks more logical (and certainly more consistent) the way things are now.

Uh, then let's keep the current code if the logical looks better.

In fact, the logical is in preprocess, has nothing change in the final object file.

Thanks for comments!