linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools/mm: use <stdbool.h> in page_owner_sort.c
@ 2025-10-15  8:58 Ye Liu
  2025-10-15  9:08 ` Dev Jain
  0 siblings, 1 reply; 3+ messages in thread
From: Ye Liu @ 2025-10-15  8:58 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Ye Liu, linux-mm, linux-kernel

From: Ye Liu <liuye@kylinos.cn>

Use standard <stdbool.h> instead of manually defining bool, true and false.

Signed-off-by: Ye Liu <liuye@kylinos.cn>
---
 tools/mm/page_owner_sort.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tools/mm/page_owner_sort.c b/tools/mm/page_owner_sort.c
index 880e36df0c11..cbd195d7b5da 100644
--- a/tools/mm/page_owner_sort.c
+++ b/tools/mm/page_owner_sort.c
@@ -13,6 +13,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdbool.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -23,9 +24,9 @@
 #include <linux/types.h>
 #include <getopt.h>
 
-#define bool int
-#define true 1
-#define false 0
+//#define bool int
+//#define true 1
+//#define false 0
 #define TASK_COMM_LEN 16
 
 struct block_list {
-- 
2.43.0



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

* Re: [PATCH] tools/mm: use <stdbool.h> in page_owner_sort.c
  2025-10-15  8:58 [PATCH] tools/mm: use <stdbool.h> in page_owner_sort.c Ye Liu
@ 2025-10-15  9:08 ` Dev Jain
  2025-10-15  9:37   ` Ye Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Dev Jain @ 2025-10-15  9:08 UTC (permalink / raw)
  To: Ye Liu, Andrew Morton; +Cc: Ye Liu, linux-mm, linux-kernel


On 15/10/25 2:28 pm, Ye Liu wrote:
> From: Ye Liu <liuye@kylinos.cn>
>
> Use standard <stdbool.h> instead of manually defining bool, true and false.
>
> Signed-off-by: Ye Liu <liuye@kylinos.cn>
> ---
>   tools/mm/page_owner_sort.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/tools/mm/page_owner_sort.c b/tools/mm/page_owner_sort.c
> index 880e36df0c11..cbd195d7b5da 100644
> --- a/tools/mm/page_owner_sort.c
> +++ b/tools/mm/page_owner_sort.c
> @@ -13,6 +13,7 @@
>   
>   #include <stdio.h>
>   #include <stdlib.h>
> +#include <stdbool.h>
>   #include <sys/types.h>
>   #include <sys/stat.h>
>   #include <fcntl.h>
> @@ -23,9 +24,9 @@
>   #include <linux/types.h>
>   #include <getopt.h>
>   
> -#define bool int
> -#define true 1
> -#define false 0
> +//#define bool int
> +//#define true 1
> +//#define false 0
>   #define TASK_COMM_LEN 16

You forgot to remove these :)

>   
>   struct block_list {


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

* Re: [PATCH] tools/mm: use <stdbool.h> in page_owner_sort.c
  2025-10-15  9:08 ` Dev Jain
@ 2025-10-15  9:37   ` Ye Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Ye Liu @ 2025-10-15  9:37 UTC (permalink / raw)
  To: Dev Jain, Andrew Morton; +Cc: Ye Liu, linux-mm, linux-kernel



在 2025/10/15 17:08, Dev Jain 写道:
> 
> On 15/10/25 2:28 pm, Ye Liu wrote:
>> From: Ye Liu <liuye@kylinos.cn>
>>
>> Use standard <stdbool.h> instead of manually defining bool, true and false.
>>
>> Signed-off-by: Ye Liu <liuye@kylinos.cn>
>> ---
>>   tools/mm/page_owner_sort.c | 7 ++++---
>>   1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/tools/mm/page_owner_sort.c b/tools/mm/page_owner_sort.c
>> index 880e36df0c11..cbd195d7b5da 100644
>> --- a/tools/mm/page_owner_sort.c
>> +++ b/tools/mm/page_owner_sort.c
>> @@ -13,6 +13,7 @@
>>     #include <stdio.h>
>>   #include <stdlib.h>
>> +#include <stdbool.h>
>>   #include <sys/types.h>
>>   #include <sys/stat.h>
>>   #include <fcntl.h>
>> @@ -23,9 +24,9 @@
>>   #include <linux/types.h>
>>   #include <getopt.h>
>>   -#define bool int
>> -#define true 1
>> -#define false 0
>> +//#define bool int
>> +//#define true 1
>> +//#define false 0
>>   #define TASK_COMM_LEN 16
> 
> You forgot to remove these :)
Oops, you're right — I’ll drop those lines and send a v2.  :)
Thanks!> 
>>     struct block_list {

-- 
Thanks,
Ye Liu



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

end of thread, other threads:[~2025-10-15  9:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-15  8:58 [PATCH] tools/mm: use <stdbool.h> in page_owner_sort.c Ye Liu
2025-10-15  9:08 ` Dev Jain
2025-10-15  9:37   ` Ye Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox