Skip to contentSkip to conversation

mm/page_alloc: fix spaces used for indentation instead of tabs

PATCH Superseded Xiang Gao 5 participants 11 messages Apr 16

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Xiang Gao

author
#0 lore raw

PATCH 1/1 mm/page_alloc: fix spaces used for indentation instead of tabs

From: Xiang Gao <[email protected]>

checkpatch.pl reports two indentation errors in page_alloc.c where spaces are used instead of tabs:

ERROR: code indent should use tabs where possible #887: FILE: mm/page_alloc.c:887:
+ VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,$

ERROR: code indent should use tabs where possible #6626: FILE: mm/page_alloc.c:6626:
+ sysctl_min_unmapped_ratio) / 100;$

In __del_page_from_free_list(), the VM_WARN_ONCE at line 887 uses 8 spaces for indentation instead of a tab. The identical VM_WARN_ONCE calls in __add_to_free_list() and move_to_free_list() both correctly use a tab.

In setup_min_unmapped_ratio(), the continuation line at 6626 uses 6 tabs + 9 spaces for alignment. Replace the excess spaces with 6 tabs
+ 1 space to correctly align with the opening parenthesis on the previous line.

---
 mm/page_alloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/page_alloc.c +2 -2
index 2d4b6f1a554e..752673a9b43c 100644
@@ -884,7 +884,7 @@ static inline void __del_page_from_free_list(struct page *page, struct zone *zon
 {
 	int nr_pages = 1 << order;
 
-        VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,
+	VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,
 		     "page type is %d, passed migratetype is %d (nr=%d)\n",
 		     get_pageblock_migratetype(page), migratetype, nr_pages);
 
@@ -6623,7 +6623,7 @@ static void setup_min_unmapped_ratio(void)
 
 	for_each_zone(zone)
 		zone->zone_pgdat->min_unmapped_pages += (zone_managed_pages(zone) *
-						         sysctl_min_unmapped_ratio) / 100;
+						 sysctl_min_unmapped_ratio) / 100;
 }
 
 
Signature · 1 line
2.34.1
#1 lore raw

Hi

Quoted 18 lines · Xiang Gao

From: Xiang Gao <[email protected]>

checkpatch.pl reports two indentation errors in page_alloc.c where spaces are used instead of tabs:

ERROR: code indent should use tabs where possible #887: FILE: mm/page_alloc.c:887:
+ VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,$

   ERROR: code indent should use tabs where possible
   #6626: FILE: mm/page_alloc.c:6626:
   +						         sysctl_min_unmapped_ratio) / 100;$

In __del_page_from_free_list(), the VM_WARN_ONCE at line 887 uses 8 spaces for indentation instead of a tab. The identical VM_WARN_ONCE calls in __add_to_free_list() and move_to_free_list() both correctly use a tab.

Quoted 7 lines

In setup_min_unmapped_ratio(), the continuation line at 6626 uses 6 tabs + 9 spaces for alignment. Replace the excess spaces with 6 tabs
+ 1 space to correctly align with the opening parenthesis on the previous line.

I am seeing below issue with checkpatch.pl

./scripts/checkpatch.pl --strict 0001-mm-page_alloc-fix-spaces-used-for-indentation-instea.patch
WARNING: From:/Signed-off-by: email name mismatch: 'From: Xiang Gao <[email protected]>' != 'Signed-off-by: gaoxiang17 <[email protected]>'

-Donet

Quoted 26 lines
---
  mm/page_alloc.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
mm/page_alloc.c +2 -2
index 2d4b6f1a554e..752673a9b43c 100644
@@ -884,7 +884,7 @@ static inline void __del_page_from_free_list(struct page *page, struct zone *zon
  {
  	int nr_pages = 1 << order;
 
-        VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,
+	VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,
  		     "page type is %d, passed migratetype is %d (nr=%d)\n",
  		     get_pageblock_migratetype(page), migratetype, nr_pages);
 
@@ -6623,7 +6623,7 @@ static void setup_min_unmapped_ratio(void)
 
  	for_each_zone(zone)
  		zone->zone_pgdat->min_unmapped_pages += (zone_managed_pages(zone) *
-						         sysctl_min_unmapped_ratio) / 100;
+						 sysctl_min_unmapped_ratio) / 100;
  }
 
 
#2 lore raw

Hi,

Thanks for catching this. I'll fix the Signed-off-by name mismatch and send a v2.

Best regards,Xiang Gao

________________________________
发件人: Donet Tom <[email protected]>
发送时间: 2026年4月16日 12:22:11
收件人: Xiang Gao; [email protected]; [email protected]
抄送: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; 高翔 主题: [External Mail]Re: [PATCH] mm/page_alloc: fix spaces used for indentation instead of tabs

[外部邮件] 此邮件来源于小米公司外部,请谨慎处理。若对邮件安全性存疑,请将邮件转发给[email protected]进行反馈

Hi

Quoted 18 lines · Xiang Gao

From: Xiang Gao <[email protected]>

checkpatch.pl reports two indentation errors in page_alloc.c where spaces are used instead of tabs:

ERROR: code indent should use tabs where possible #887: FILE: mm/page_alloc.c:887:
+ VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,$

ERROR: code indent should use tabs where possible #6626: FILE: mm/page_alloc.c:6626:
+ sysctl_min_unmapped_ratio) / 100;$

In __del_page_from_free_list(), the VM_WARN_ONCE at line 887 uses 8 spaces for indentation instead of a tab. The identical VM_WARN_ONCE calls in __add_to_free_list() and move_to_free_list() both correctly use a tab.

Quoted 7 lines

In setup_min_unmapped_ratio(), the continuation line at 6626 uses 6 tabs + 9 spaces for alignment. Replace the excess spaces with 6 tabs
+ 1 space to correctly align with the opening parenthesis on the previous line.

I am seeing below issue with checkpatch.pl

./scripts/checkpatch.pl --strict 0001-mm-page_alloc-fix-spaces-used-for-indentation-instea.patch
WARNING: From:/Signed-off-by: email name mismatch: 'From: Xiang Gao <[email protected]>' != 'Signed-off-by: gaoxiang17 <[email protected]>'

-Donet

Quoted 26 lines
---
  mm/page_alloc.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
mm/page_alloc.c +2 -2
index 2d4b6f1a554e..752673a9b43c 100644
@@ -884,7 +884,7 @@ static inline void __del_page_from_free_list(struct page *page, struct zone *zon
  {
      int nr_pages = 1 << order;
 
-        VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,
+     VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,
                   "page type is %d, passed migratetype is %d (nr=%d)\n",
                   get_pageblock_migratetype(page), migratetype, nr_pages);
 
@@ -6623,7 +6623,7 @@ static void setup_min_unmapped_ratio(void)
 
      for_each_zone(zone)
              zone->zone_pgdat->min_unmapped_pages += (zone_managed_pages(zone) *
-                                                      sysctl_min_unmapped_ratio) / 100;
+                                              sysctl_min_unmapped_ratio) / 100;
  }
 
 
author
#3 lore raw

PATCH v2 1/1 mm/page_alloc: fix spaces used for indentation instead of tabs

In reply to Xiang Gao

From: Xiang Gao <[email protected]>

checkpatch.pl reports two indentation errors in page_alloc.c where spaces are used instead of tabs:

ERROR: code indent should use tabs where possible #887: FILE: mm/page_alloc.c:887:
+ VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,$

ERROR: code indent should use tabs where possible #6626: FILE: mm/page_alloc.c:6626:
+ sysctl_min_unmapped_ratio) / 100;$

In __del_page_from_free_list(), the VM_WARN_ONCE at line 887 uses 8 spaces for indentation instead of a tab. The identical VM_WARN_ONCE calls in __add_to_free_list() and move_to_free_list() both correctly use a tab.

In setup_min_unmapped_ratio(), the continuation line at 6626 uses 6 tabs + 9 spaces for alignment. Replace the excess spaces with 6 tabs
+ 1 space to correctly align with the opening parenthesis on the previous line.

---
 mm/page_alloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/page_alloc.c +2 -2
index 2d4b6f1a554e..752673a9b43c 100644
@@ -884,7 +884,7 @@ static inline void __del_page_from_free_list(struct page *page, struct zone *zon
 {
 	int nr_pages = 1 << order;
 
-        VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,
+	VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,
 		     "page type is %d, passed migratetype is %d (nr=%d)\n",
 		     get_pageblock_migratetype(page), migratetype, nr_pages);
 
@@ -6623,7 +6623,7 @@ static void setup_min_unmapped_ratio(void)
 
 	for_each_zone(zone)
 		zone->zone_pgdat->min_unmapped_pages += (zone_managed_pages(zone) *
-						         sysctl_min_unmapped_ratio) / 100;
+						 sysctl_min_unmapped_ratio) / 100;
 }
 
 
Signature · 1 line
2.34.1
#4 lore raw

Hi

Quoted 18 lines · Xiang Gao

From: Xiang Gao<[email protected]>

checkpatch.pl reports two indentation errors in page_alloc.c where spaces are used instead of tabs:

ERROR: code indent should use tabs where possible #887: FILE: mm/page_alloc.c:887:
+ VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,$

   ERROR: code indent should use tabs where possible
   #6626: FILE: mm/page_alloc.c:6626:
   +						         sysctl_min_unmapped_ratio) / 100;$

In __del_page_from_free_list(), the VM_WARN_ONCE at line 887 uses 8 spaces for indentation instead of a tab. The identical VM_WARN_ONCE calls in __add_to_free_list() and move_to_free_list() both correctly use a tab.

Quoted 6 lines

In setup_min_unmapped_ratio(), the continuation line at 6626 uses 6 tabs + 9 spaces for alignment. Replace the excess spaces with 6 tabs
+ 1 space to correctly align with the opening parenthesis on the previous line.

It might be better to send v2 as a new series next time —just a suggestion.

LGTM Reviewed by: Donet Tom <[email protected]> -Donet

Quoted 26 lines
---
  mm/page_alloc.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
mm/page_alloc.c +2 -2
index 2d4b6f1a554e..752673a9b43c 100644
@@ -884,7 +884,7 @@ static inline void __del_page_from_free_list(struct page *page, struct zone *zon
  {
  	int nr_pages = 1 << order;
 
-        VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,
+	VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,
  		     "page type is %d, passed migratetype is %d (nr=%d)\n",
  		     get_pageblock_migratetype(page), migratetype, nr_pages);
 
@@ -6623,7 +6623,7 @@ static void setup_min_unmapped_ratio(void)
 
  	for_each_zone(zone)
  		zone->zone_pgdat->min_unmapped_pages += (zone_managed_pages(zone) *
-						         sysctl_min_unmapped_ratio) / 100;
+						 sysctl_min_unmapped_ratio) / 100;
  }
 
 
#5 lore raw

ok, thanks.

________________________________
发件人: Donet Tom <[email protected]>
发送时间: 2026年4月16日 13:48:23
收件人: Xiang Gao; Andrew Morton
抄送: [email protected]; [email protected]; [email protected]; 高翔 主题: [External Mail]Re: [PATCH v2] mm/page_alloc: fix spaces used for indentation instead of tabs

[外部邮件] 此邮件来源于小米公司外部,请谨慎处理。若对邮件安全性存疑,请将邮件转发给[email protected]进行反馈

Hi

On 4/16/26 10:57 AM, Xiang Gao wrote:

From: Xiang Gao <[email protected]><mailto:[email protected]>

checkpatch.pl reports two indentation errors in page_alloc.c where spaces are used instead of tabs:

ERROR: code indent should use tabs where possible #887: FILE: mm/page_alloc.c:887:
+ VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,$

ERROR: code indent should use tabs where possible #6626: FILE: mm/page_alloc.c:6626:
+ sysctl_min_unmapped_ratio) / 100;$

In __del_page_from_free_list(), the VM_WARN_ONCE at line 887 uses 8 spaces for indentation instead of a tab. The identical VM_WARN_ONCE calls in __add_to_free_list() and move_to_free_list() both correctly use a tab.

In setup_min_unmapped_ratio(), the continuation line at 6626 uses 6 tabs + 9 spaces for alignment. Replace the excess spaces with 6 tabs
+ 1 space to correctly align with the opening parenthesis on the previous line.

It might be better to send v2 as a new series next time —just a suggestion.

LGTM Reviewed by: Donet Tom <[email protected]><mailto:[email protected]> -Donet

---
 mm/page_alloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/page_alloc.c +2 -2
index 2d4b6f1a554e..752673a9b43c 100644
@@ -884,7 +884,7 @@ static inline void __del_page_from_free_list(struct page *page, struct zone *zon
 {
        int nr_pages = 1 << order;
 
-        VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,
+       VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,
                     "page type is %d, passed migratetype is %d (nr=%d)\n",
                     get_pageblock_migratetype(page), migratetype, nr_pages);
 
@@ -6623,7 +6623,7 @@ static void setup_min_unmapped_ratio(void)
 
        for_each_zone(zone)
                zone->zone_pgdat->min_unmapped_pages += (zone_managed_pages(zone) *
-                                                        sysctl_min_unmapped_ratio) / 100;
+                                                sysctl_min_unmapped_ratio) / 100;
 }
 
 
#6 lore raw
In reply to Donet Tom

I've sent the updated patches as v3 with your Reviewed-by tag included. Thank you for the review and the suggestion — I'll send v2/v3 as new series going forward.

________________________________
发件人: Donet Tom <[email protected]>
发送时间: 2026年4月16日 13:48:23
收件人: Xiang Gao; Andrew Morton
抄送: [email protected]; [email protected]; [email protected]; 高翔 主题: [External Mail]Re: [PATCH v2] mm/page_alloc: fix spaces used for indentation instead of tabs

[外部邮件] 此邮件来源于小米公司外部,请谨慎处理。若对邮件安全性存疑,请将邮件转发给[email protected]进行反馈

Hi

On 4/16/26 10:57 AM, Xiang Gao wrote:

From: Xiang Gao <[email protected]><mailto:[email protected]>

checkpatch.pl reports two indentation errors in page_alloc.c where spaces are used instead of tabs:

ERROR: code indent should use tabs where possible #887: FILE: mm/page_alloc.c:887:
+ VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,$

ERROR: code indent should use tabs where possible #6626: FILE: mm/page_alloc.c:6626:
+ sysctl_min_unmapped_ratio) / 100;$

In __del_page_from_free_list(), the VM_WARN_ONCE at line 887 uses 8 spaces for indentation instead of a tab. The identical VM_WARN_ONCE calls in __add_to_free_list() and move_to_free_list() both correctly use a tab.

In setup_min_unmapped_ratio(), the continuation line at 6626 uses 6 tabs + 9 spaces for alignment. Replace the excess spaces with 6 tabs
+ 1 space to correctly align with the opening parenthesis on the previous line.

It might be better to send v2 as a new series next time —just a suggestion.

LGTM Reviewed by: Donet Tom <[email protected]><mailto:[email protected]> -Donet

---
 mm/page_alloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/page_alloc.c +2 -2
index 2d4b6f1a554e..752673a9b43c 100644
@@ -884,7 +884,7 @@ static inline void __del_page_from_free_list(struct page *page, struct zone *zon
 {
        int nr_pages = 1 << order;
 
-        VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,
+       VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,
                     "page type is %d, passed migratetype is %d (nr=%d)\n",
                     get_pageblock_migratetype(page), migratetype, nr_pages);
 
@@ -6623,7 +6623,7 @@ static void setup_min_unmapped_ratio(void)
 
        for_each_zone(zone)
                zone->zone_pgdat->min_unmapped_pages += (zone_managed_pages(zone) *
-                                                        sysctl_min_unmapped_ratio) / 100;
+                                                sysctl_min_unmapped_ratio) / 100;
 }
 
 
#7 lore raw
In reply to Xiang Gao
Quoted 13 lines · Xiang Gao

From: Xiang Gao <[email protected]>

checkpatch.pl reports two indentation errors in page_alloc.c where spaces are used instead of tabs:

ERROR: code indent should use tabs where possible #887: FILE: mm/page_alloc.c:887:
+ VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,$

ERROR: code indent should use tabs where possible #6626: FILE: mm/page_alloc.c:6626:
+ sysctl_min_unmapped_ratio) / 100;$

Quoted 7 lines

In __del_page_from_free_list(), the VM_WARN_ONCE at line 887 uses 8 spaces for indentation instead of a tab. The identical VM_WARN_ONCE calls in __add_to_free_list() and move_to_free_list() both correctly use a tab.

In setup_min_unmapped_ratio(), the continuation line at 6626 uses 6 tabs + 9 spaces for alignment. Replace the excess spaces with 6 tabs

6 tabs + 9 spaces -> 7 tabs + 1 space.

Quoted 30 lines

+ 1 space to correctly align with the opening parenthesis on the previous line.

---
 mm/page_alloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/page_alloc.c +2 -2
index 2d4b6f1a554e..752673a9b43c 100644
@@ -884,7 +884,7 @@ static inline void __del_page_from_free_list(struct page *page, struct zone *zon
 {
 	int nr_pages = 1 << order;
 
-        VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,
+	VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,
 		     "page type is %d, passed migratetype is %d (nr=%d)\n",
 		     get_pageblock_migratetype(page), migratetype, nr_pages);
 
@@ -6623,7 +6623,7 @@ static void setup_min_unmapped_ratio(void)
 
 	for_each_zone(zone)
 		zone->zone_pgdat->min_unmapped_pages += (zone_managed_pages(zone) *
-						         sysctl_min_unmapped_ratio) / 100;
+						 sysctl_min_unmapped_ratio) / 100;
 }
 
 
#8 lore raw

You're right, "6 tabs + 9 spaces" is effectively "7 tabs + 1 space" since 8 of those spaces equal one tab width. The description in the commit message should have phrased it that way. The actual code change is correct — the result is 6 tabs + 1 space to align with the opening parenthesis on the previous line. Thank you for the review.

________________________________
发件人: Dev Jain <[email protected]>
发送时间: 2026年4月16日 14:34:42
收件人: Xiang Gao; Andrew Morton
抄送: [email protected]; [email protected]; [email protected]; 高翔 主题: [External Mail]Re: [PATCH v2] mm/page_alloc: fix spaces used for indentation instead of tabs

[外部邮件] 此邮件来源于小米公司外部,请谨慎处理。若对邮件安全性存疑,请将邮件转发给[email protected]进行反馈

Quoted 13 lines · Xiang Gao

From: Xiang Gao <[email protected]>

checkpatch.pl reports two indentation errors in page_alloc.c where spaces are used instead of tabs:

ERROR: code indent should use tabs where possible #887: FILE: mm/page_alloc.c:887:
+ VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,$

ERROR: code indent should use tabs where possible #6626: FILE: mm/page_alloc.c:6626:
+ sysctl_min_unmapped_ratio) / 100;$

Quoted 7 lines

In __del_page_from_free_list(), the VM_WARN_ONCE at line 887 uses 8 spaces for indentation instead of a tab. The identical VM_WARN_ONCE calls in __add_to_free_list() and move_to_free_list() both correctly use a tab.

In setup_min_unmapped_ratio(), the continuation line at 6626 uses 6 tabs + 9 spaces for alignment. Replace the excess spaces with 6 tabs

6 tabs + 9 spaces -> 7 tabs + 1 space.

Quoted 30 lines

+ 1 space to correctly align with the opening parenthesis on the previous line.

---
 mm/page_alloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/page_alloc.c +2 -2
index 2d4b6f1a554e..752673a9b43c 100644
@@ -884,7 +884,7 @@ static inline void __del_page_from_free_list(struct page *page, struct zone *zon
 {
      int nr_pages = 1 << order;
 
-        VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,
+     VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,
                   "page type is %d, passed migratetype is %d (nr=%d)\n",
                   get_pageblock_migratetype(page), migratetype, nr_pages);
 
@@ -6623,7 +6623,7 @@ static void setup_min_unmapped_ratio(void)
 
      for_each_zone(zone)
              zone->zone_pgdat->min_unmapped_pages += (zone_managed_pages(zone) *
-                                                      sysctl_min_unmapped_ratio) / 100;
+                                              sysctl_min_unmapped_ratio) / 100;
 }
 
 
#9 lore raw
In reply to Xiang Gao
Quoted 4 lines · Xiang Gao

From: Xiang Gao <[email protected]>

checkpatch.pl reports two indentation errors in page_alloc.c where spaces are used instead of tabs:

checkpatch should not be used on existing source files, only on patches changing them for another reason. There are many pre-existing things that would be flagged and we don't want the churn. So we only use checkpatch to avoid introducing new mistakes, and only fix the pre-existing ones when changing the code for another reason.

Quoted 45 lines

ERROR: code indent should use tabs where possible #887: FILE: mm/page_alloc.c:887:
+ VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,$

ERROR: code indent should use tabs where possible #6626: FILE: mm/page_alloc.c:6626:
+ sysctl_min_unmapped_ratio) / 100;$

In __del_page_from_free_list(), the VM_WARN_ONCE at line 887 uses 8 spaces for indentation instead of a tab. The identical VM_WARN_ONCE calls in __add_to_free_list() and move_to_free_list() both correctly use a tab.

In setup_min_unmapped_ratio(), the continuation line at 6626 uses 6 tabs + 9 spaces for alignment. Replace the excess spaces with 6 tabs
+ 1 space to correctly align with the opening parenthesis on the previous line.

---
 mm/page_alloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/page_alloc.c +2 -2
index 2d4b6f1a554e..752673a9b43c 100644
@@ -884,7 +884,7 @@ static inline void __del_page_from_free_list(struct page *page, struct zone *zon
 {
 	int nr_pages = 1 << order;
 
-        VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,
+	VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,
 		     "page type is %d, passed migratetype is %d (nr=%d)\n",
 		     get_pageblock_migratetype(page), migratetype, nr_pages);
 
@@ -6623,7 +6623,7 @@ static void setup_min_unmapped_ratio(void)
 
 	for_each_zone(zone)
 		zone->zone_pgdat->min_unmapped_pages += (zone_managed_pages(zone) *
-						         sysctl_min_unmapped_ratio) / 100;
+						 sysctl_min_unmapped_ratio) / 100;
 }
 
 
#10 lore raw

Thank you for the feedback. I understand — checkpatch should only be used on patches, not to find and fix pre-existing style issues in existing code. I'll keep this in mind for future submissions. Sorry for the noise.

________________________________
发件人: Vlastimil Babka (SUSE) <[email protected]>
发送时间: 2026年4月16日 14:40:31
收件人: Xiang Gao; [email protected]
抄送: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; 高翔 主题: [External Mail]Re: [PATCH] mm/page_alloc: fix spaces used for indentation instead of tabs

[外部邮件] 此邮件来源于小米公司外部,请谨慎处理。若对邮件安全性存疑,请将邮件转发给[email protected]进行反馈

Quoted 4 lines · Xiang Gao

From: Xiang Gao <[email protected]>

checkpatch.pl reports two indentation errors in page_alloc.c where spaces are used instead of tabs:

checkpatch should not be used on existing source files, only on patches changing them for another reason. There are many pre-existing things that would be flagged and we don't want the churn. So we only use checkpatch to avoid introducing new mistakes, and only fix the pre-existing ones when changing the code for another reason.

Quoted 45 lines

ERROR: code indent should use tabs where possible #887: FILE: mm/page_alloc.c:887:
+ VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,$

ERROR: code indent should use tabs where possible #6626: FILE: mm/page_alloc.c:6626:
+ sysctl_min_unmapped_ratio) / 100;$

In __del_page_from_free_list(), the VM_WARN_ONCE at line 887 uses 8 spaces for indentation instead of a tab. The identical VM_WARN_ONCE calls in __add_to_free_list() and move_to_free_list() both correctly use a tab.

In setup_min_unmapped_ratio(), the continuation line at 6626 uses 6 tabs + 9 spaces for alignment. Replace the excess spaces with 6 tabs
+ 1 space to correctly align with the opening parenthesis on the previous line.

---
 mm/page_alloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/page_alloc.c +2 -2
index 2d4b6f1a554e..752673a9b43c 100644
@@ -884,7 +884,7 @@ static inline void __del_page_from_free_list(struct page *page, struct zone *zon
 {
      int nr_pages = 1 << order;
 
-        VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,
+     VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,
                   "page type is %d, passed migratetype is %d (nr=%d)\n",
                   get_pageblock_migratetype(page), migratetype, nr_pages);
 
@@ -6623,7 +6623,7 @@ static void setup_min_unmapped_ratio(void)
 
      for_each_zone(zone)
              zone->zone_pgdat->min_unmapped_pages += (zone_managed_pages(zone) *
-                                                      sysctl_min_unmapped_ratio) / 100;
+                                              sysctl_min_unmapped_ratio) / 100;
 }