linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] mm: skip less than check for MAX_NR_ZONES
@ 2024-08-19 11:26 alexs
  2024-08-20  4:40 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: alexs @ 2024-08-19 11:26 UTC (permalink / raw)
  To: open list; +Cc: Alex Shi, linux-mm, Andrew Morton

From: Alex Shi <alexs@kernel.org>

Remove unnecessary '<' check for ZONES_SHIFT assignment.

Signed-off-by: Alex Shi <alexs@kernel.org>
Cc: linux-mm@kvack.org
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 include/linux/page-flags-layout.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/page-flags-layout.h b/include/linux/page-flags-layout.h
index 7d79818dc065..7edc2b8a3414 100644
--- a/include/linux/page-flags-layout.h
+++ b/include/linux/page-flags-layout.h
@@ -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
-- 
2.43.0



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

* Re: [PATCH v2] mm: skip less than check for MAX_NR_ZONES
  2024-08-19 11:26 [PATCH v2] mm: skip less than check for MAX_NR_ZONES alexs
@ 2024-08-20  4:40 ` Andrew Morton
  2024-08-20 10:06   ` Alex Shi
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2024-08-20  4:40 UTC (permalink / raw)
  To: alexs; +Cc: open list, linux-mm

On Mon, 19 Aug 2024 19:26:28 +0800 alexs@kernel.org wrote:

> From: Alex Shi <alexs@kernel.org>
> 
> Remove unnecessary '<' check for ZONES_SHIFT assignment.
> 
> ...
>
> --- a/include/linux/page-flags-layout.h
> +++ b/include/linux/page-flags-layout.h
> @@ -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.



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

* Re: [PATCH v2] mm: skip less than check for MAX_NR_ZONES
  2024-08-20  4:40 ` Andrew Morton
@ 2024-08-20 10:06   ` Alex Shi
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Shi @ 2024-08-20 10:06 UTC (permalink / raw)
  To: Andrew Morton, alexs; +Cc: open list, linux-mm



On 8/20/24 12:40 PM, Andrew Morton wrote:
> On Mon, 19 Aug 2024 19:26:28 +0800 alexs@kernel.org wrote:
> 
>> From: Alex Shi <alexs@kernel.org>
>>
>> Remove unnecessary '<' check for ZONES_SHIFT assignment.
>>
>> ...
>>
>> --- a/include/linux/page-flags-layout.h
>> +++ b/include/linux/page-flags-layout.h
>> @@ -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!
 


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

end of thread, other threads:[~2024-08-20 10:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-19 11:26 [PATCH v2] mm: skip less than check for MAX_NR_ZONES alexs
2024-08-20  4:40 ` Andrew Morton
2024-08-20 10:06   ` Alex Shi

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).