linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/vmstat: Fix indentation in fold_diff function.
@ 2025-10-21  7:37 Jing Su
  2025-10-21  7:57 ` David Hildenbrand
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Jing Su @ 2025-10-21  7:37 UTC (permalink / raw)
  To: akpm, david, lorenzo.stoakes, Liam.Howlett, vbabka, rppt, surenb,
	mhocko
  Cc: linux-mm, linux-kernel, jinnasujing

Adjust misaligned braces in the fold_diff function to improve
code readability and maintain consistent coding style.

Signed-off-by: Jing Su <jingsusu@didiglobal.com>
---
 mm/vmstat.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/vmstat.c b/mm/vmstat.c
index bb09c032eecf..63860c3d22e6 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -782,13 +782,13 @@ static int fold_diff(int *zone_diff, int *node_diff)
 		if (zone_diff[i]) {
 			atomic_long_add(zone_diff[i], &vm_zone_stat[i]);
 			changes++;
-	}
+		}
 
 	for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++)
 		if (node_diff[i]) {
 			atomic_long_add(node_diff[i], &vm_node_stat[i]);
 			changes++;
-	}
+		}
 	return changes;
 }
 
-- 
2.34.1



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

* Re: [PATCH] mm/vmstat: Fix indentation in fold_diff function.
  2025-10-21  7:37 [PATCH] mm/vmstat: Fix indentation in fold_diff function Jing Su
@ 2025-10-21  7:57 ` David Hildenbrand
  2025-10-21  9:03 ` Vlastimil Babka
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: David Hildenbrand @ 2025-10-21  7:57 UTC (permalink / raw)
  To: akpm, lorenzo.stoakes, Liam.Howlett, vbabka, rppt, surenb, mhocko,
	linux-mm, linux-kernel, jinnasujing

On 21.10.25 09:37, Jing Su wrote:
> Adjust misaligned braces in the fold_diff function to improve
> code readability and maintain consistent coding style.
> 
> Signed-off-by: Jing Su <jingsusu@didiglobal.com>
> ---
>   mm/vmstat.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/vmstat.c b/mm/vmstat.c
> index bb09c032eecf..63860c3d22e6 100644
> --- a/mm/vmstat.c
> +++ b/mm/vmstat.c
> @@ -782,13 +782,13 @@ static int fold_diff(int *zone_diff, int *node_diff)
>   		if (zone_diff[i]) {
>   			atomic_long_add(zone_diff[i], &vm_zone_stat[i]);
>   			changes++;
> -	}
> +		}
>   
>   	for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++)
>   		if (node_diff[i]) {
>   			atomic_long_add(node_diff[i], &vm_node_stat[i]);
>   			changes++;
> -	}
> +		}
>   	return changes;
>   }
>   

Acked-by: David Hildenbrand <david@redhat.com>

-- 
Cheers

David / dhildenb



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

* Re: [PATCH] mm/vmstat: Fix indentation in fold_diff function.
  2025-10-21  7:37 [PATCH] mm/vmstat: Fix indentation in fold_diff function Jing Su
  2025-10-21  7:57 ` David Hildenbrand
@ 2025-10-21  9:03 ` Vlastimil Babka
  2025-10-21 16:10   ` Liam R. Howlett
  2025-10-21  9:19 ` Lorenzo Stoakes
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 8+ messages in thread
From: Vlastimil Babka @ 2025-10-21  9:03 UTC (permalink / raw)
  To: akpm, david, lorenzo.stoakes, Liam.Howlett, rppt, surenb, mhocko,
	linux-mm, linux-kernel, jinnasujing

On 10/21/25 09:37, Jing Su wrote:
> Adjust misaligned braces in the fold_diff function to improve
> code readability and maintain consistent coding style.
> 
> Signed-off-by: Jing Su <jingsusu@didiglobal.com>
> ---
>  mm/vmstat.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/vmstat.c b/mm/vmstat.c
> index bb09c032eecf..63860c3d22e6 100644
> --- a/mm/vmstat.c
> +++ b/mm/vmstat.c
> @@ -782,13 +782,13 @@ static int fold_diff(int *zone_diff, int *node_diff)
>  		if (zone_diff[i]) {
>  			atomic_long_add(zone_diff[i], &vm_zone_stat[i]);
>  			changes++;
> -	}
> +		}
>  
>  	for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++)
>  		if (node_diff[i]) {
>  			atomic_long_add(node_diff[i], &vm_node_stat[i]);
>  			changes++;
> -	}
> +		}
>  	return changes;
>  }

Thanks. IMHO it would be even more readable if the for () also had {
}brackets.



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

* Re: [PATCH] mm/vmstat: Fix indentation in fold_diff function.
  2025-10-21  7:37 [PATCH] mm/vmstat: Fix indentation in fold_diff function Jing Su
  2025-10-21  7:57 ` David Hildenbrand
  2025-10-21  9:03 ` Vlastimil Babka
@ 2025-10-21  9:19 ` Lorenzo Stoakes
  2025-10-21  9:21 ` Donet Tom
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Lorenzo Stoakes @ 2025-10-21  9:19 UTC (permalink / raw)
  To: akpm, david, Liam.Howlett, vbabka, rppt, surenb, mhocko, linux-mm,
	linux-kernel, jinnasujing

On Tue, Oct 21, 2025 at 03:37:07PM +0800, Jing Su wrote:
> Adjust misaligned braces in the fold_diff function to improve
> code readability and maintain consistent coding style.
>
> Signed-off-by: Jing Su <jingsusu@didiglobal.com>

Yikes, can't believe it was off like that :)

LGTM, so:

Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>

> ---
>  mm/vmstat.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/vmstat.c b/mm/vmstat.c
> index bb09c032eecf..63860c3d22e6 100644
> --- a/mm/vmstat.c
> +++ b/mm/vmstat.c
> @@ -782,13 +782,13 @@ static int fold_diff(int *zone_diff, int *node_diff)
>  		if (zone_diff[i]) {
>  			atomic_long_add(zone_diff[i], &vm_zone_stat[i]);
>  			changes++;
> -	}
> +		}
>
>  	for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++)
>  		if (node_diff[i]) {
>  			atomic_long_add(node_diff[i], &vm_node_stat[i]);
>  			changes++;
> -	}
> +		}
>  	return changes;
>  }
>
> --
> 2.34.1
>


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

* Re: [PATCH] mm/vmstat: Fix indentation in fold_diff function.
  2025-10-21  7:37 [PATCH] mm/vmstat: Fix indentation in fold_diff function Jing Su
                   ` (2 preceding siblings ...)
  2025-10-21  9:19 ` Lorenzo Stoakes
@ 2025-10-21  9:21 ` Donet Tom
  2025-10-21 20:14 ` Vlastimil Babka
  2025-10-22  3:56 ` Dev Jain
  5 siblings, 0 replies; 8+ messages in thread
From: Donet Tom @ 2025-10-21  9:21 UTC (permalink / raw)
  To: akpm, david, lorenzo.stoakes, Liam.Howlett, vbabka, rppt, surenb,
	mhocko, linux-mm, linux-kernel, jinnasujing


On 10/21/25 1:07 PM, Jing Su wrote:
> Adjust misaligned braces in the fold_diff function to improve
> code readability and maintain consistent coding style.
>
> Signed-off-by: Jing Su <jingsusu@didiglobal.com>


LGTM

Reviewed-by: Donet Tom <donettom@linux.ibm.com>

> ---
>   mm/vmstat.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/vmstat.c b/mm/vmstat.c
> index bb09c032eecf..63860c3d22e6 100644
> --- a/mm/vmstat.c
> +++ b/mm/vmstat.c
> @@ -782,13 +782,13 @@ static int fold_diff(int *zone_diff, int *node_diff)
>   		if (zone_diff[i]) {
>   			atomic_long_add(zone_diff[i], &vm_zone_stat[i]);
>   			changes++;
> -	}
> +		}
>   
>   	for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++)
>   		if (node_diff[i]) {
>   			atomic_long_add(node_diff[i], &vm_node_stat[i]);
>   			changes++;
> -	}
> +		}
>   	return changes;
>   }
>   


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

* Re: [PATCH] mm/vmstat: Fix indentation in fold_diff function.
  2025-10-21  9:03 ` Vlastimil Babka
@ 2025-10-21 16:10   ` Liam R. Howlett
  0 siblings, 0 replies; 8+ messages in thread
From: Liam R. Howlett @ 2025-10-21 16:10 UTC (permalink / raw)
  To: Vlastimil Babka
  Cc: akpm, david, lorenzo.stoakes, rppt, surenb, mhocko, linux-mm,
	linux-kernel, jinnasujing

* Vlastimil Babka <vbabka@suse.cz> [251021 05:03]:
> On 10/21/25 09:37, Jing Su wrote:
> > Adjust misaligned braces in the fold_diff function to improve
> > code readability and maintain consistent coding style.
> > 
> > Signed-off-by: Jing Su <jingsusu@didiglobal.com>
> > ---
> >  mm/vmstat.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/mm/vmstat.c b/mm/vmstat.c
> > index bb09c032eecf..63860c3d22e6 100644
> > --- a/mm/vmstat.c
> > +++ b/mm/vmstat.c
> > @@ -782,13 +782,13 @@ static int fold_diff(int *zone_diff, int *node_diff)
> >  		if (zone_diff[i]) {
> >  			atomic_long_add(zone_diff[i], &vm_zone_stat[i]);
> >  			changes++;
> > -	}
> > +		}
> >  
> >  	for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++)
> >  		if (node_diff[i]) {
> >  			atomic_long_add(node_diff[i], &vm_node_stat[i]);
> >  			changes++;
> > -	}
> > +		}
> >  	return changes;
> >  }
> 
> Thanks. IMHO it would be even more readable if the for () also had {
> }brackets.

Yes, I agree.  That's probably how this happened in the first place.




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

* Re: [PATCH] mm/vmstat: Fix indentation in fold_diff function.
  2025-10-21  7:37 [PATCH] mm/vmstat: Fix indentation in fold_diff function Jing Su
                   ` (3 preceding siblings ...)
  2025-10-21  9:21 ` Donet Tom
@ 2025-10-21 20:14 ` Vlastimil Babka
  2025-10-22  3:56 ` Dev Jain
  5 siblings, 0 replies; 8+ messages in thread
From: Vlastimil Babka @ 2025-10-21 20:14 UTC (permalink / raw)
  To: akpm, david, lorenzo.stoakes, Liam.Howlett, rppt, surenb, mhocko,
	linux-mm, linux-kernel, jinnasujing

On 10/21/25 09:37, Jing Su wrote:
> Adjust misaligned braces in the fold_diff function to improve
> code readability and maintain consistent coding style.
> 
> Signed-off-by: Jing Su <jingsusu@didiglobal.com>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

Thanks Andrew for adding extra brackets fixup.

> ---
>  mm/vmstat.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/vmstat.c b/mm/vmstat.c
> index bb09c032eecf..63860c3d22e6 100644
> --- a/mm/vmstat.c
> +++ b/mm/vmstat.c
> @@ -782,13 +782,13 @@ static int fold_diff(int *zone_diff, int *node_diff)
>  		if (zone_diff[i]) {
>  			atomic_long_add(zone_diff[i], &vm_zone_stat[i]);
>  			changes++;
> -	}
> +		}
>  
>  	for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++)
>  		if (node_diff[i]) {
>  			atomic_long_add(node_diff[i], &vm_node_stat[i]);
>  			changes++;
> -	}
> +		}
>  	return changes;
>  }
>  



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

* Re: [PATCH] mm/vmstat: Fix indentation in fold_diff function.
  2025-10-21  7:37 [PATCH] mm/vmstat: Fix indentation in fold_diff function Jing Su
                   ` (4 preceding siblings ...)
  2025-10-21 20:14 ` Vlastimil Babka
@ 2025-10-22  3:56 ` Dev Jain
  5 siblings, 0 replies; 8+ messages in thread
From: Dev Jain @ 2025-10-22  3:56 UTC (permalink / raw)
  To: akpm, david, lorenzo.stoakes, Liam.Howlett, vbabka, rppt, surenb,
	mhocko, linux-mm, linux-kernel, jinnasujing


On 21/10/25 1:07 pm, Jing Su wrote:
> Adjust misaligned braces in the fold_diff function to improve
> code readability and maintain consistent coding style.
>
> Signed-off-by: Jing Su <jingsusu@didiglobal.com>

Reviewed-by: Dev Jain <dev.jain@arm.com>
  
  



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

end of thread, other threads:[~2025-10-22  3:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-21  7:37 [PATCH] mm/vmstat: Fix indentation in fold_diff function Jing Su
2025-10-21  7:57 ` David Hildenbrand
2025-10-21  9:03 ` Vlastimil Babka
2025-10-21 16:10   ` Liam R. Howlett
2025-10-21  9:19 ` Lorenzo Stoakes
2025-10-21  9:21 ` Donet Tom
2025-10-21 20:14 ` Vlastimil Babka
2025-10-22  3:56 ` Dev Jain

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