* [PATCH] mm/huge_memory: fix various coding style warnings
2026-09-05 14:01 [PATCH 0/3] mm: minor janitorial style cleanups Christos Skarlos
@ 2026-09-05 14:01 ` Christos Skarlos
2026-09-05 16:07 ` Zi Yan
2026-09-05 14:01 ` [PATCH 1/3] mm/mmap: " Christos Skarlos
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: Christos Skarlos @ 2026-09-05 14:01 UTC (permalink / raw)
To: akpm, david, muchun.song, osalvador, ljs, hannes
Cc: ziy, baolin.wang, liam, nico.pache, ryan.roberts, dev.jain,
baohua, lance.yang, usama.arif, kas, vbabka, jannh, pfalcato,
kasong, qi.zheng, shakeel.butt, axelrasmussen, yuanchu, weixugc,
mhocko, linux-mm, linux-kernel, Christos Skarlos
Resolve coding style issues flagged by checkpatch.pl Specifically:
- Add missing blank lines after variable declarations.
- Remove unnecessary braces {} for a single statement block.
No functional changes are introduced.
Signed-off-by: Christos Skarlos <christosskarlos.kernel@gmail.com>
---
mm/huge_memory.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index ced400f72d43..371ee8d38c45 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1104,6 +1104,7 @@ subsys_initcall(hugepage_init);
static int __init setup_transparent_hugepage(char *str)
{
int ret = 0;
+
if (!str)
goto out;
if (!strcmp(str, "always")) {
@@ -1510,6 +1511,7 @@ static void set_huge_zero_folio(pgtable_t pgtable, struct mm_struct *mm,
struct folio *zero_folio)
{
pmd_t entry;
+
entry = folio_mk_pmd(zero_folio, vma->vm_page_prot);
entry = pmd_mkspecial(entry);
pgtable_trans_huge_deposit(mm, pmd, pgtable);
@@ -2613,6 +2615,7 @@ bool move_huge_pmd(struct vm_area_struct *vma, unsigned long old_addr,
if (pmd_move_must_withdraw(new_ptl, old_ptl, vma)) {
pgtable_t pgtable;
+
pgtable = pgtable_trans_huge_withdraw(mm, old_pmd);
pgtable_trans_huge_deposit(mm, new_pmd, pgtable);
}
@@ -3901,9 +3904,8 @@ int folio_check_splittable(struct folio *folio, unsigned int new_order,
* swapcache folio split. Only uniform split to order-0 can be used
* here.
*/
- if ((split_type == SPLIT_TYPE_NON_UNIFORM || new_order) && folio_test_swapcache(folio)) {
+ if ((split_type == SPLIT_TYPE_NON_UNIFORM || new_order) && folio_test_swapcache(folio))
return -EINVAL;
- }
if (is_huge_zero_folio(folio))
return -EINVAL;
--
2.55.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH] mm/huge_memory: fix various coding style warnings
2026-09-05 14:01 ` [PATCH] mm/huge_memory: fix various coding style warnings Christos Skarlos
@ 2026-09-05 16:07 ` Zi Yan
0 siblings, 0 replies; 9+ messages in thread
From: Zi Yan @ 2026-09-05 16:07 UTC (permalink / raw)
To: Christos Skarlos, akpm, david, muchun.song, osalvador, ljs,
hannes
Cc: baolin.wang, liam, nico.pache, ryan.roberts, dev.jain, baohua,
lance.yang, usama.arif, kas, vbabka, jannh, pfalcato, kasong,
qi.zheng, shakeel.butt, axelrasmussen, yuanchu, weixugc, mhocko,
linux-mm, linux-kernel
On Sat Sep 5, 2026 at 10:01 AM EDT, Christos Skarlos wrote:
> Resolve coding style issues flagged by checkpatch.pl Specifically:
> - Add missing blank lines after variable declarations.
> - Remove unnecessary braces {} for a single statement block.
>
> No functional changes are introduced.
>
> Signed-off-by: Christos Skarlos <christosskarlos.kernel@gmail.com>
> ---
> mm/huge_memory.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
You already sent this one out[1] and it is reviewed. I guess this is
sent out by accident.
[1] https://lore.kernel.org/all/20260903092200.88910-1-christosskarlos.kernel@gmail.com/
--
Best Regards,
Yan, Zi
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/3] mm/mmap: fix various coding style warnings
2026-09-05 14:01 [PATCH 0/3] mm: minor janitorial style cleanups Christos Skarlos
2026-09-05 14:01 ` [PATCH] mm/huge_memory: fix various coding style warnings Christos Skarlos
@ 2026-09-05 14:01 ` Christos Skarlos
2026-09-05 16:19 ` Zi Yan
2026-09-05 14:01 ` [PATCH 2/3] mm/vamscan: fix various coding style warnings and errors Christos Skarlos
2026-09-05 14:01 ` [PATCH 3/3] mm/hugetlb: fix various coding style warnings Christos Skarlos
3 siblings, 1 reply; 9+ messages in thread
From: Christos Skarlos @ 2026-09-05 14:01 UTC (permalink / raw)
To: akpm, david, muchun.song, osalvador, ljs, hannes
Cc: ziy, baolin.wang, liam, nico.pache, ryan.roberts, dev.jain,
baohua, lance.yang, usama.arif, kas, vbabka, jannh, pfalcato,
kasong, qi.zheng, shakeel.butt, axelrasmussen, yuanchu, weixugc,
mhocko, linux-mm, linux-kernel, Christos Skarlos
Resolve coding style warnings and errors flagged by checkpatch.pl script. Specifically:
- Remove the obsolete filename reference in the top comment.
- Replace <asm/cacheflush.h> and <asm/mmu_context.h> with <linux/...>.
- Add missing blank lines after variable declarations and replace spaces with tabs where needed.
No functional changes are introduced.
Signed-off-by: Christos Skarlos <christosskarlos.kernel@gmail.com>
---
mm/mmap.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/mm/mmap.c b/mm/mmap.c
index 4bf26b0f1e6e..626d3d2493ae 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
- * mm/mmap.c
*
* Written by obz.
*
@@ -50,9 +49,9 @@
#include <linux/memfd.h>
#include <linux/uaccess.h>
-#include <asm/cacheflush.h>
+#include <linux/cacheflush.h>
#include <asm/tlb.h>
-#include <asm/mmu_context.h>
+#include <linux/mmu_context.h>
#define CREATE_TRACE_POINTS
#include <trace/events/mmap.h>
@@ -526,9 +525,9 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
* And don't attempt to combine with hugetlb for now.
*/
if (flags & (MAP_LOCKED | MAP_HUGETLB))
- return -EINVAL;
+ return -EINVAL;
if (vma_flags_can_grow(&vma_flags))
- return -EINVAL;
+ return -EINVAL;
/*
* If the pages can be dropped, then it doesn't make
@@ -832,6 +831,7 @@ __get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
= NULL;
unsigned long error = arch_mmap_check(addr, len, flags);
+
if (error)
return error;
@@ -942,6 +942,7 @@ find_vma_prev(struct mm_struct *mm, unsigned long addr,
struct vm_area_struct **pprev)
{
struct vm_area_struct *vma;
+
VMA_ITERATOR(vmi, mm, addr);
vma = vma_iter_load(&vmi);
@@ -1017,12 +1018,12 @@ struct vm_area_struct *find_extend_vma_locked(struct mm_struct *mm, unsigned lon
#if defined(CONFIG_STACK_GROWSUP)
-#define vma_expand_up(vma,addr) expand_upwards(vma, addr)
+#define vma_expand_up(vma, addr) expand_upwards(vma, addr)
#define vma_expand_down(vma, addr) (-EFAULT)
#else
-#define vma_expand_up(vma,addr) (-EFAULT)
+#define vma_expand_up(vma, addr) (-EFAULT)
#define vma_expand_down(vma, addr) expand_downwards(vma, addr)
#endif
@@ -1227,6 +1228,7 @@ int vm_brk_flags(unsigned long addr, unsigned long request, bool is_exec)
int ret;
bool populate;
LIST_HEAD(uf);
+
VMA_ITERATOR(vmi, mm, addr);
len = PAGE_ALIGN(request);
@@ -1290,6 +1292,7 @@ void exit_mmap(struct mm_struct *mm)
struct mmu_gather tlb;
struct vm_area_struct *vma;
unsigned long nr_accounted = 0;
+
VMA_ITERATOR(vmi, mm, 0);
struct unmap_desc unmap;
@@ -1454,6 +1457,7 @@ static vm_fault_t special_mapping_fault(struct vm_fault *vmf)
if (*pages) {
struct page *page = *pages;
+
get_page(page);
vmf->page = page;
return 0;
@@ -1711,6 +1715,7 @@ __latent_entropy int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
int retval;
unsigned long charge = 0;
LIST_HEAD(uf);
+
VMA_ITERATOR(vmi, mm, 0);
if (mmap_write_lock_killable(oldmm))
--
2.55.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH 1/3] mm/mmap: fix various coding style warnings
2026-09-05 14:01 ` [PATCH 1/3] mm/mmap: " Christos Skarlos
@ 2026-09-05 16:19 ` Zi Yan
0 siblings, 0 replies; 9+ messages in thread
From: Zi Yan @ 2026-09-05 16:19 UTC (permalink / raw)
To: Christos Skarlos, akpm, david, muchun.song, osalvador, ljs,
hannes
Cc: baolin.wang, liam, nico.pache, ryan.roberts, dev.jain, baohua,
lance.yang, usama.arif, kas, vbabka, jannh, pfalcato, kasong,
qi.zheng, shakeel.butt, axelrasmussen, yuanchu, weixugc, mhocko,
linux-mm, linux-kernel
On Sat Sep 5, 2026 at 10:01 AM EDT, Christos Skarlos wrote:
> Resolve coding style warnings and errors flagged by checkpatch.pl script. Specifically:
> - Remove the obsolete filename reference in the top comment.
> - Replace <asm/cacheflush.h> and <asm/mmu_context.h> with <linux/...>.
> - Add missing blank lines after variable declarations and replace spaces with tabs where needed.
>
> No functional changes are introduced.
>
> Signed-off-by: Christos Skarlos <christosskarlos.kernel@gmail.com>
> ---
> mm/mmap.c | 19 ++++++++++++-------
> 1 file changed, 12 insertions(+), 7 deletions(-)
>
> diff --git a/mm/mmap.c b/mm/mmap.c
> index 4bf26b0f1e6e..626d3d2493ae 100644
> --- a/mm/mmap.c
> +++ b/mm/mmap.c
> @@ -1,6 +1,5 @@
> // SPDX-License-Identifier: GPL-2.0-only
> /*
> - * mm/mmap.c
Why?
> *
> * Written by obz.
> *
> @@ -50,9 +49,9 @@
> #include <linux/memfd.h>
>
> #include <linux/uaccess.h>
> -#include <asm/cacheflush.h>
> +#include <linux/cacheflush.h>
> #include <asm/tlb.h>
> -#include <asm/mmu_context.h>
> +#include <linux/mmu_context.h>
mmap.c does not use any functions in linux versions, why replace asm
versions with them? checkpatch.pl has no check for these.
<snip>
> @@ -942,6 +942,7 @@ find_vma_prev(struct mm_struct *mm, unsigned long addr,
> struct vm_area_struct **pprev)
> {
> struct vm_area_struct *vma;
> +
> VMA_ITERATOR(vmi, mm, addr);
Have you checked the definition of VMA_ITERATOR? It declares struct
vma_iterator.
>
> vma = vma_iter_load(&vmi);
> @@ -1017,12 +1018,12 @@ struct vm_area_struct *find_extend_vma_locked(struct mm_struct *mm, unsigned lon
>
> #if defined(CONFIG_STACK_GROWSUP)
>
> -#define vma_expand_up(vma,addr) expand_upwards(vma, addr)
> +#define vma_expand_up(vma, addr) expand_upwards(vma, addr)
> #define vma_expand_down(vma, addr) (-EFAULT)
>
> #else
>
> -#define vma_expand_up(vma,addr) (-EFAULT)
> +#define vma_expand_up(vma, addr) (-EFAULT)
> #define vma_expand_down(vma, addr) expand_downwards(vma, addr)
>
> #endif
> @@ -1227,6 +1228,7 @@ int vm_brk_flags(unsigned long addr, unsigned long request, bool is_exec)
> int ret;
> bool populate;
> LIST_HEAD(uf);
> +
> VMA_ITERATOR(vmi, mm, addr);
Ditto.
>
> len = PAGE_ALIGN(request);
> @@ -1290,6 +1292,7 @@ void exit_mmap(struct mm_struct *mm)
> struct mmu_gather tlb;
> struct vm_area_struct *vma;
> unsigned long nr_accounted = 0;
> +
> VMA_ITERATOR(vmi, mm, 0);
> struct unmap_desc unmap;
Ditto.
>
> @@ -1454,6 +1457,7 @@ static vm_fault_t special_mapping_fault(struct vm_fault *vmf)
>
> if (*pages) {
> struct page *page = *pages;
> +
> get_page(page);
> vmf->page = page;
> return 0;
> @@ -1711,6 +1715,7 @@ __latent_entropy int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
> int retval;
> unsigned long charge = 0;
> LIST_HEAD(uf);
> +
> VMA_ITERATOR(vmi, mm, 0);
Ditto.
>
> if (mmap_write_lock_killable(oldmm))
--
Best Regards,
Yan, Zi
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/3] mm/vamscan: fix various coding style warnings and errors
2026-09-05 14:01 [PATCH 0/3] mm: minor janitorial style cleanups Christos Skarlos
2026-09-05 14:01 ` [PATCH] mm/huge_memory: fix various coding style warnings Christos Skarlos
2026-09-05 14:01 ` [PATCH 1/3] mm/mmap: " Christos Skarlos
@ 2026-09-05 14:01 ` Christos Skarlos
2026-09-05 16:22 ` Zi Yan
2026-09-05 14:01 ` [PATCH 3/3] mm/hugetlb: fix various coding style warnings Christos Skarlos
3 siblings, 1 reply; 9+ messages in thread
From: Christos Skarlos @ 2026-09-05 14:01 UTC (permalink / raw)
To: akpm, david, muchun.song, osalvador, ljs, hannes
Cc: ziy, baolin.wang, liam, nico.pache, ryan.roberts, dev.jain,
baohua, lance.yang, usama.arif, kas, vbabka, jannh, pfalcato,
kasong, qi.zheng, shakeel.butt, axelrasmussen, yuanchu, weixugc,
mhocko, linux-mm, linux-kernel, Christos Skarlos
Resolve coding style issues flagged by checkpatch.pl script. Specifically:
- Add missing blank lines after variable declarations.
- Replace "unsigned" with "unsigned int".
- Replace spaces with tabs where possible.
No functional changes are introduced.
Signed-off-by: Christos Skarlos <christosskarlos.kernel@gmail.com>
---
mm/vmscan.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index f11491ee9ed5..8637cc0910fa 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -535,7 +535,7 @@ void reclaim_throttle(pg_data_t *pgdat, enum vmscan_throttle_state reason)
* writeback to a slow device to excessive referenced folios at the tail
* of the inactive LRU.
*/
- switch(reason) {
+ switch (reason) {
case VMSCAN_THROTTLE_WRITEBACK:
timeout = HZ/10;
@@ -1529,6 +1529,7 @@ static unsigned int shrink_folio_list(struct list_head *folio_list,
VM_BUG_ON_FOLIO(folio_test_active(folio), folio);
if (!folio_test_mlocked(folio)) {
int type = folio_is_file_lru(folio);
+
folio_set_active(folio);
stat->nr_activate[type] += nr_pages;
count_memcg_folio_events(folio, PGACTIVATE, nr_pages);
@@ -2073,8 +2074,8 @@ static void shrink_active_list(unsigned long nr_to_scan,
LIST_HEAD(l_hold); /* The folios which were snipped off */
LIST_HEAD(l_active);
LIST_HEAD(l_inactive);
- unsigned nr_deactivate, nr_activate;
- unsigned nr_rotated = 0;
+ unsigned int nr_deactivate, nr_activate;
+ unsigned int nr_rotated = 0;
bool file = is_file_lru(lru);
struct pglist_data *pgdat = lruvec_pgdat(lruvec);
@@ -2614,7 +2615,7 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc,
/*
* If there is enough inactive page cache, we do not reclaim
* anything from the anonymous working right now to make sure
- * a streaming file access pattern doesn't cause swapping.
+ * a streaming file access pattern doesn't cause swapping.
*/
if (sc->cache_trim_mode) {
scan_balance = SCAN_FILE;
@@ -3416,6 +3417,7 @@ static bool get_next_vma(unsigned long mask, unsigned long size, struct mm_walk
{
unsigned long start = round_up(*vm_end, size);
unsigned long end = (start | ~mask) + 1;
+
VMA_ITERATOR(vmi, args->mm, start);
VM_WARN_ON_ONCE(mask & size);
@@ -7748,7 +7750,7 @@ static int __init kswapd_init(void)
int nid;
for_each_node_state(nid, N_MEMORY)
- kswapd_run(nid);
+ kswapd_run(nid);
register_sysctl_init("vm", vmscan_sysctl_table);
return 0;
}
--
2.55.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH 2/3] mm/vamscan: fix various coding style warnings and errors
2026-09-05 14:01 ` [PATCH 2/3] mm/vamscan: fix various coding style warnings and errors Christos Skarlos
@ 2026-09-05 16:22 ` Zi Yan
0 siblings, 0 replies; 9+ messages in thread
From: Zi Yan @ 2026-09-05 16:22 UTC (permalink / raw)
To: Christos Skarlos, akpm, david, muchun.song, osalvador, ljs,
hannes
Cc: baolin.wang, liam, nico.pache, ryan.roberts, dev.jain, baohua,
lance.yang, usama.arif, kas, vbabka, jannh, pfalcato, kasong,
qi.zheng, shakeel.butt, axelrasmussen, yuanchu, weixugc, mhocko,
linux-mm, linux-kernel
On Sat Sep 5, 2026 at 10:01 AM EDT, Christos Skarlos wrote:
> Resolve coding style issues flagged by checkpatch.pl script. Specifically:
> - Add missing blank lines after variable declarations.
> - Replace "unsigned" with "unsigned int".
> - Replace spaces with tabs where possible.
>
> No functional changes are introduced.
>
> Signed-off-by: Christos Skarlos <christosskarlos.kernel@gmail.com>
> ---
> mm/vmscan.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
Your subject has a typo: s/vamscan/vmscan
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index f11491ee9ed5..8637cc0910fa 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -535,7 +535,7 @@ void reclaim_throttle(pg_data_t *pgdat, enum vmscan_throttle_state reason)
> * writeback to a slow device to excessive referenced folios at the tail
> * of the inactive LRU.
> */
> - switch(reason) {
> + switch (reason) {
> case VMSCAN_THROTTLE_WRITEBACK:
> timeout = HZ/10;
>
> @@ -1529,6 +1529,7 @@ static unsigned int shrink_folio_list(struct list_head *folio_list,
> VM_BUG_ON_FOLIO(folio_test_active(folio), folio);
> if (!folio_test_mlocked(folio)) {
> int type = folio_is_file_lru(folio);
> +
> folio_set_active(folio);
> stat->nr_activate[type] += nr_pages;
> count_memcg_folio_events(folio, PGACTIVATE, nr_pages);
> @@ -2073,8 +2074,8 @@ static void shrink_active_list(unsigned long nr_to_scan,
> LIST_HEAD(l_hold); /* The folios which were snipped off */
> LIST_HEAD(l_active);
> LIST_HEAD(l_inactive);
> - unsigned nr_deactivate, nr_activate;
> - unsigned nr_rotated = 0;
> + unsigned int nr_deactivate, nr_activate;
> + unsigned int nr_rotated = 0;
> bool file = is_file_lru(lru);
> struct pglist_data *pgdat = lruvec_pgdat(lruvec);
>
> @@ -2614,7 +2615,7 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc,
> /*
> * If there is enough inactive page cache, we do not reclaim
> * anything from the anonymous working right now to make sure
> - * a streaming file access pattern doesn't cause swapping.
> + * a streaming file access pattern doesn't cause swapping.
> */
> if (sc->cache_trim_mode) {
> scan_balance = SCAN_FILE;
> @@ -3416,6 +3417,7 @@ static bool get_next_vma(unsigned long mask, unsigned long size, struct mm_walk
> {
> unsigned long start = round_up(*vm_end, size);
> unsigned long end = (start | ~mask) + 1;
> +
> VMA_ITERATOR(vmi, args->mm, start);
Like I said in patch 1, no new line is needed here.
--
Best Regards,
Yan, Zi
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 3/3] mm/hugetlb: fix various coding style warnings.
2026-09-05 14:01 [PATCH 0/3] mm: minor janitorial style cleanups Christos Skarlos
` (2 preceding siblings ...)
2026-09-05 14:01 ` [PATCH 2/3] mm/vamscan: fix various coding style warnings and errors Christos Skarlos
@ 2026-09-05 14:01 ` Christos Skarlos
2026-09-05 16:24 ` Zi Yan
3 siblings, 1 reply; 9+ messages in thread
From: Christos Skarlos @ 2026-09-05 14:01 UTC (permalink / raw)
To: akpm, david, muchun.song, osalvador, ljs, hannes
Cc: ziy, baolin.wang, liam, nico.pache, ryan.roberts, dev.jain,
baohua, lance.yang, usama.arif, kas, vbabka, jannh, pfalcato,
kasong, qi.zheng, shakeel.butt, axelrasmussen, yuanchu, weixugc,
mhocko, linux-mm, linux-kernel, Christos Skarlos
Resolve coding style issues flagged by the checkpatch.pl script. Specifically:
- Fix block comment formatting to keep tailing '*/' on a separate line.
- Add missing blank lines after variable declarations.
- Remove anecessary braces {} from single statement blocks.
No functional changes where introduced.
Signed-off-by: Christos Skarlos <christosskarlos.kernel@gmail.com>
---
mm/hugetlb.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 4f6f58bf3db6..ec8e799e356e 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -145,7 +145,8 @@ static inline void unlock_or_release_subpool(struct hugepage_subpool *spool,
/* If no pages are used, and no other handles to the subpool
* remain, give up any reservations based on minimum size and
- * free the subpool */
+ * free the subpool
+ */
spin_unlock_irqrestore(&spool->lock, irq_flags);
if (free_subpool) {
@@ -3700,6 +3701,7 @@ static void try_to_free_low(struct hstate *h, unsigned long count,
for_each_node_mask(i, *nodes_allowed) {
struct folio *folio, *next;
struct list_head *freel = &h->hugepage_freelists[i];
+
list_for_each_entry_safe(folio, next, freel, lru) {
if (count >= h->nr_huge_pages)
goto out;
@@ -3764,6 +3766,7 @@ static int set_max_huge_pages(struct hstate *h, unsigned long count, int nid,
unsigned long allocated;
struct folio *folio;
LIST_HEAD(page_list);
+
NODEMASK_ALLOC(nodemask_t, node_alloc_noretry, GFP_KERNEL);
/*
@@ -4188,9 +4191,9 @@ void __init hugetlb_add_hstate(unsigned int order)
struct hstate *h;
unsigned long i;
- if (size_to_hstate(PAGE_SIZE << order)) {
+ if (size_to_hstate(PAGE_SIZE << order))
return;
- }
+
BUG_ON(hugetlb_max_hstate >= HUGE_MAX_HSTATE);
BUG_ON(order < order_base_2(__NR_USED_SUBPAGE));
WARN_ON(order > MAX_FOLIO_ORDER);
@@ -4832,11 +4835,11 @@ static pte_t make_huge_pte(struct vm_area_struct *vma, struct folio *folio,
pte_t entry = folio_mk_pte(folio, vma->vm_page_prot);
unsigned int shift = huge_page_shift(hstate_vma(vma));
- if (try_mkwrite && (vma->vm_flags & VM_WRITE)) {
+ if (try_mkwrite && (vma->vm_flags & VM_WRITE))
entry = pte_mkwrite_novma(pte_mkdirty(entry));
- } else {
+ else
entry = pte_wrprotect(entry);
- }
+
entry = pte_mkyoung(entry);
entry = arch_make_huge_pte(entry, shift, vma->vm_flags);
@@ -4919,6 +4922,7 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
last_addr_mask = hugetlb_mask_last_page(h);
for (addr = src_vma->vm_start; addr < src_vma->vm_end; addr += sz) {
spinlock_t *src_ptl, *dst_ptl;
+
src_pte = hugetlb_walk(src_vma, addr, sz);
if (!src_pte) {
addr |= last_addr_mask;
@@ -6321,6 +6325,7 @@ int hugetlb_mfill_atomic_pte(pte_t *dst_pte,
folio = alloc_hugetlb_folio(dst_vma, dst_addr, false);
if (IS_ERR(folio)) {
pte_t *actual_pte = hugetlb_walk(dst_vma, dst_addr, PMD_SIZE);
+
if (actual_pte) {
ret = -EEXIST;
goto out;
--
2.55.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH 3/3] mm/hugetlb: fix various coding style warnings.
2026-09-05 14:01 ` [PATCH 3/3] mm/hugetlb: fix various coding style warnings Christos Skarlos
@ 2026-09-05 16:24 ` Zi Yan
0 siblings, 0 replies; 9+ messages in thread
From: Zi Yan @ 2026-09-05 16:24 UTC (permalink / raw)
To: Christos Skarlos, akpm, david, muchun.song, osalvador, ljs,
hannes
Cc: baolin.wang, liam, nico.pache, ryan.roberts, dev.jain, baohua,
lance.yang, usama.arif, kas, vbabka, jannh, pfalcato, kasong,
qi.zheng, shakeel.butt, axelrasmussen, yuanchu, weixugc, mhocko,
linux-mm, linux-kernel
On Sat Sep 5, 2026 at 10:01 AM EDT, Christos Skarlos wrote:
> Resolve coding style issues flagged by the checkpatch.pl script. Specifically:
> - Fix block comment formatting to keep tailing '*/' on a separate line.
> - Add missing blank lines after variable declarations.
> - Remove anecessary braces {} from single statement blocks.
>
> No functional changes where introduced.
>
> Signed-off-by: Christos Skarlos <christosskarlos.kernel@gmail.com>
> ---
> mm/hugetlb.c | 17 +++++++++++------
> 1 file changed, 11 insertions(+), 6 deletions(-)
>
<snip>
> @@ -3764,6 +3766,7 @@ static int set_max_huge_pages(struct hstate *h, unsigned long count, int nid,
> unsigned long allocated;
> struct folio *folio;
> LIST_HEAD(page_list);
> +
> NODEMASK_ALLOC(nodemask_t, node_alloc_noretry, GFP_KERNEL);
Please check the definition of NODEMASK_ALLOC. No new line is needed
here.
--
Best Regards,
Yan, Zi
^ permalink raw reply [flat|nested] 9+ messages in thread