* [PATCH 0/3] mm: Coccinelle-driven cleanups across memory management code
@ 2025-11-18 6:08 Sahil Chandna
2025-11-18 6:08 ` [PATCH 1/3] mm/pagewalk: use min() macro instead of manual ternary Sahil Chandna
` (2 more replies)
0 siblings, 3 replies; 16+ messages in thread
From: Sahil Chandna @ 2025-11-18 6:08 UTC (permalink / raw)
To: akpm, david, lorenzo.stoakes, mhocko, vbabka, rppt, surenb,
hannes, shakeel.butt, zhengqi.arch, Liam.Howlett, weixugc,
axelrasmussen, yuanchu, yosry.ahmed, nphamcs, chengming.zhou,
linux-mm, linux-kernel
Cc: Sahil Chandna
This patch series contains three minor cleanups identified by
Coccinelle scripts under scripts/coccinelle/misc/:
* Replace manual ternary expression with the min() macro in pagewalk.c
* Use the %pe printk format specifier for PTR_ERR() reporting
in vmscan.c and zswap.c
Found using:
make coccicheck MODE=report M=mm/
Sahil Chandna (3):
mm/pagewalk: use min() macro instead of manual ternary
mm/vmscan: use %pe to print PTR_ERR() values
mm/zswap: use %pe to print PTR_ERR() values
mm/pagewalk.c | 2 +-
mm/vmscan.c | 4 ++--
mm/zswap.c | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
--
2.50.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 1/3] mm/pagewalk: use min() macro instead of manual ternary
2025-11-18 6:08 [PATCH 0/3] mm: Coccinelle-driven cleanups across memory management code Sahil Chandna
@ 2025-11-18 6:08 ` Sahil Chandna
2025-11-18 10:19 ` Markus Elfring
2025-11-18 10:45 ` David Laight
2025-11-18 6:08 ` [PATCH 2/3] mm/vmscan: use %pe to print PTR_ERR() values Sahil Chandna
2025-11-18 6:08 ` [PATCH 3/3] mm/zswap: " Sahil Chandna
2 siblings, 2 replies; 16+ messages in thread
From: Sahil Chandna @ 2025-11-18 6:08 UTC (permalink / raw)
To: akpm, david, lorenzo.stoakes, mhocko, vbabka, rppt, surenb,
hannes, shakeel.butt, zhengqi.arch, Liam.Howlett, weixugc,
axelrasmussen, yuanchu, yosry.ahmed, nphamcs, chengming.zhou,
linux-mm, linux-kernel
Cc: Sahil Chandna
mm: pagewalk: use min() macro instead of manual ternary expression
Use the kernel-provided min() macro to compute the minimum value instead
of an explicit ternary expression. This improves readability and matches
common kernel style.
This was flagged by Coccinelle
(misc/minmax.cocci) as an opportunity to use min().
Found by: make coccicheck MODE=report M=mm/
No functional change intended.
Signed-off-by: Sahil Chandna <chandna.sahil@gmail.com>
---
mm/pagewalk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/pagewalk.c b/mm/pagewalk.c
index 9f91cf85a5be..82db421b5b34 100644
--- a/mm/pagewalk.c
+++ b/mm/pagewalk.c
@@ -313,7 +313,7 @@ static unsigned long hugetlb_entry_end(struct hstate *h, unsigned long addr,
unsigned long end)
{
unsigned long boundary = (addr & huge_page_mask(h)) + huge_page_size(h);
- return boundary < end ? boundary : end;
+ return min(boundary, end);
}
static int walk_hugetlb_range(unsigned long addr, unsigned long end,
--
2.50.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 2/3] mm/vmscan: use %pe to print PTR_ERR() values
2025-11-18 6:08 [PATCH 0/3] mm: Coccinelle-driven cleanups across memory management code Sahil Chandna
2025-11-18 6:08 ` [PATCH 1/3] mm/pagewalk: use min() macro instead of manual ternary Sahil Chandna
@ 2025-11-18 6:08 ` Sahil Chandna
2025-11-18 13:15 ` Markus Elfring
2025-11-19 1:52 ` SeongJae Park
2025-11-18 6:08 ` [PATCH 3/3] mm/zswap: " Sahil Chandna
2 siblings, 2 replies; 16+ messages in thread
From: Sahil Chandna @ 2025-11-18 6:08 UTC (permalink / raw)
To: akpm, david, lorenzo.stoakes, mhocko, vbabka, rppt, surenb,
hannes, shakeel.butt, zhengqi.arch, Liam.Howlett, weixugc,
axelrasmussen, yuanchu, yosry.ahmed, nphamcs, chengming.zhou,
linux-mm, linux-kernel
Cc: Sahil Chandna
Use the %pe printk format specifier to report error pointers directly
instead of printing PTR_ERR() as a long value. This improves clarity,
produces more readable error messages.
This instance was flagged by the Coccinelle script
(misc/ptr_err_to_pe.cocci) as an opportunity to adopt %pe.
Found by: make coccicheck MODE=report M=mm/
No functional change intended
Signed-off-by: Sahil Chandna <chandna.sahil@gmail.com>
---
mm/vmscan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index b2fc8b626d3d..7d5b41696cc3 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -7500,8 +7500,8 @@ void __meminit kswapd_run(int nid)
pgdat->kswapd = kthread_create_on_node(kswapd, pgdat, nid, "kswapd%d", nid);
if (IS_ERR(pgdat->kswapd)) {
/* failure at boot is fatal */
- pr_err("Failed to start kswapd on node %d,ret=%ld\n",
- nid, PTR_ERR(pgdat->kswapd));
+ pr_err("Failed to start kswapd on node %d,ret=%pe\n",
+ nid, pgdat->kswapd);
BUG_ON(system_state < SYSTEM_RUNNING);
pgdat->kswapd = NULL;
} else {
--
2.50.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 3/3] mm/zswap: use %pe to print PTR_ERR() values
2025-11-18 6:08 [PATCH 0/3] mm: Coccinelle-driven cleanups across memory management code Sahil Chandna
2025-11-18 6:08 ` [PATCH 1/3] mm/pagewalk: use min() macro instead of manual ternary Sahil Chandna
2025-11-18 6:08 ` [PATCH 2/3] mm/vmscan: use %pe to print PTR_ERR() values Sahil Chandna
@ 2025-11-18 6:08 ` Sahil Chandna
2025-11-18 13:20 ` Markus Elfring
` (3 more replies)
2 siblings, 4 replies; 16+ messages in thread
From: Sahil Chandna @ 2025-11-18 6:08 UTC (permalink / raw)
To: akpm, david, lorenzo.stoakes, mhocko, vbabka, rppt, surenb,
hannes, shakeel.butt, zhengqi.arch, Liam.Howlett, weixugc,
axelrasmussen, yuanchu, yosry.ahmed, nphamcs, chengming.zhou,
linux-mm, linux-kernel
Cc: Sahil Chandna
Use the %pe printk format specifier to report error pointers directly
instead of printing PTR_ERR() as a long value. This improves clarity,
produces more readable error messages.
This instance was flagged by the Coccinelle script
(misc/ptr_err_to_pe.cocci) as an opportunity to adopt %pe.
Found by: make coccicheck MODE=report M=mm/
No functional change intended.
Signed-off-by: Sahil Chandna <chandna.sahil@gmail.com>
---
mm/zswap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/zswap.c b/mm/zswap.c
index c1af782e54ec..c35604db32ad 100644
--- a/mm/zswap.c
+++ b/mm/zswap.c
@@ -749,8 +749,8 @@ static int zswap_cpu_comp_prepare(unsigned int cpu, struct hlist_node *node)
acomp = crypto_alloc_acomp_node(pool->tfm_name, 0, 0, cpu_to_node(cpu));
if (IS_ERR(acomp)) {
- pr_err("could not alloc crypto acomp %s : %ld\n",
- pool->tfm_name, PTR_ERR(acomp));
+ pr_err("could not alloc crypto acomp %s : %pe\n",
+ pool->tfm_name, acomp);
ret = PTR_ERR(acomp);
goto fail;
}
--
2.50.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/3] mm/pagewalk: use min() macro instead of manual ternary
2025-11-18 6:08 ` [PATCH 1/3] mm/pagewalk: use min() macro instead of manual ternary Sahil Chandna
@ 2025-11-18 10:19 ` Markus Elfring
2025-11-18 10:45 ` David Laight
1 sibling, 0 replies; 16+ messages in thread
From: Markus Elfring @ 2025-11-18 10:19 UTC (permalink / raw)
To: Sahil Chandna, linux-mm
Cc: LKML, Andrew Morton, Axel Rasmussen, Chengming Zhou,
David Hildenbrand, Johannes Weiner, Liam R. Howlett,
Lorenzo Stoakes, Michal Hocko, Mike Rapoport, Nhat Pham,
Qi Zheng, Shakeel Butt, Suren Baghdasaryan, Vlastimil Babka,
Wei Xu, Yosry Ahmed, Yuanchu Xie
> mm: pagewalk: use min() macro instead of manual ternary expression
How do you think about to avoid the repetition of a patch subject
in the change description?
…
> This was flagged by Coccinelle
> (misc/minmax.cocci) as an opportunity to use min().
Would an other word wrapping be a bit nicer?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.18-rc6#n658
Regards,
Markus
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/3] mm/pagewalk: use min() macro instead of manual ternary
2025-11-18 6:08 ` [PATCH 1/3] mm/pagewalk: use min() macro instead of manual ternary Sahil Chandna
2025-11-18 10:19 ` Markus Elfring
@ 2025-11-18 10:45 ` David Laight
2025-11-18 15:18 ` Matthew Wilcox
1 sibling, 1 reply; 16+ messages in thread
From: David Laight @ 2025-11-18 10:45 UTC (permalink / raw)
To: Sahil Chandna
Cc: akpm, david, lorenzo.stoakes, mhocko, vbabka, rppt, surenb,
hannes, shakeel.butt, zhengqi.arch, Liam.Howlett, weixugc,
axelrasmussen, yuanchu, yosry.ahmed, nphamcs, chengming.zhou,
linux-mm, linux-kernel
On Tue, 18 Nov 2025 11:38:49 +0530
Sahil Chandna <chandna.sahil@gmail.com> wrote:
> mm: pagewalk: use min() macro instead of manual ternary expression
>
> Use the kernel-provided min() macro to compute the minimum value instead
> of an explicit ternary expression. This improves readability and matches
> common kernel style.
>
> This was flagged by Coccinelle
> (misc/minmax.cocci) as an opportunity to use min().
>
> Found by: make coccicheck MODE=report M=mm/
> No functional change intended.
>
> Signed-off-by: Sahil Chandna <chandna.sahil@gmail.com>
> ---
> mm/pagewalk.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/pagewalk.c b/mm/pagewalk.c
> index 9f91cf85a5be..82db421b5b34 100644
> --- a/mm/pagewalk.c
> +++ b/mm/pagewalk.c
> @@ -313,7 +313,7 @@ static unsigned long hugetlb_entry_end(struct hstate *h, unsigned long addr,
> unsigned long end)
> {
> unsigned long boundary = (addr & huge_page_mask(h)) + huge_page_size(h);
> - return boundary < end ? boundary : end;
> + return min(boundary, end);
You can remove the temporary:
return min((addr & huge_page_mask(h)) + huge_page_size(h), end);
David
> }
>
> static int walk_hugetlb_range(unsigned long addr, unsigned long end,
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 2/3] mm/vmscan: use %pe to print PTR_ERR() values
2025-11-18 6:08 ` [PATCH 2/3] mm/vmscan: use %pe to print PTR_ERR() values Sahil Chandna
@ 2025-11-18 13:15 ` Markus Elfring
2025-11-19 1:52 ` SeongJae Park
1 sibling, 0 replies; 16+ messages in thread
From: Markus Elfring @ 2025-11-18 13:15 UTC (permalink / raw)
To: Sahil Chandna, linux-mm
Cc: LKML, Andrew Morton, Axel Rasmussen, Chengming Zhou,
David Hildenbrand, Johannes Weiner, Liam R. Howlett,
Lorenzo Stoakes, Michal Hocko, Mike Rapoport, Nhat Pham,
Qi Zheng, Shakeel Butt, Suren Baghdasaryan, Vlastimil Babka,
Wei Xu, Yosry Ahmed, Yuanchu Xie
…
> +++ b/mm/vmscan.c
> @@ -7500,8 +7500,8 @@ void __meminit kswapd_run(int nid)
> pgdat->kswapd = kthread_create_on_node(kswapd, pgdat, nid, "kswapd%d", nid);
> if (IS_ERR(pgdat->kswapd)) {
…
> + pr_err("Failed to start kswapd on node %d,ret=%pe\n",
> + nid, pgdat->kswapd);
> BUG_ON(system_state < SYSTEM_RUNNING);
…
I propose to adjust the indentation for the passed parameters.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v6.18-rc6#n110
Regards,
Markus
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 3/3] mm/zswap: use %pe to print PTR_ERR() values
2025-11-18 6:08 ` [PATCH 3/3] mm/zswap: " Sahil Chandna
@ 2025-11-18 13:20 ` Markus Elfring
2025-11-18 15:11 ` Matthew Wilcox
2025-11-18 15:46 ` Yosry Ahmed
` (2 subsequent siblings)
3 siblings, 1 reply; 16+ messages in thread
From: Markus Elfring @ 2025-11-18 13:20 UTC (permalink / raw)
To: Sahil Chandna, linux-mm
Cc: LKML, Andrew Morton, Axel Rasmussen, Chengming Zhou,
David Hildenbrand, Johannes Weiner, Liam R. Howlett,
Lorenzo Stoakes, Michal Hocko, Mike Rapoport, Nhat Pham,
Qi Zheng, Shakeel Butt, Suren Baghdasaryan, Vlastimil Babka,
Wei Xu, Yosry Ahmed, Yuanchu Xie
…
> +++ b/mm/zswap.c
> @@ -749,8 +749,8 @@ static int zswap_cpu_comp_prepare(unsigned int cpu, struct hlist_node *node)
>
> acomp = crypto_alloc_acomp_node(pool->tfm_name, 0, 0, cpu_to_node(cpu));
> if (IS_ERR(acomp)) {
…
> + pr_err("could not alloc crypto acomp %s : %pe\n",
> + pool->tfm_name, acomp);
> ret = PTR_ERR(acomp);
…
Would you like to reduce the indentation for the passed parameters?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v6.18-rc6#n110
Regards,
Markus
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 3/3] mm/zswap: use %pe to print PTR_ERR() values
2025-11-18 13:20 ` Markus Elfring
@ 2025-11-18 15:11 ` Matthew Wilcox
2025-11-18 19:28 ` Markus Elfring
0 siblings, 1 reply; 16+ messages in thread
From: Matthew Wilcox @ 2025-11-18 15:11 UTC (permalink / raw)
To: Markus Elfring
Cc: Sahil Chandna, linux-mm, LKML, Andrew Morton, Axel Rasmussen,
Chengming Zhou, David Hildenbrand, Johannes Weiner,
Liam R. Howlett, Lorenzo Stoakes, Michal Hocko, Mike Rapoport,
Nhat Pham, Qi Zheng, Shakeel Butt, Suren Baghdasaryan,
Vlastimil Babka, Wei Xu, Yosry Ahmed, Yuanchu Xie
On Tue, Nov 18, 2025 at 02:20:59PM +0100, Markus Elfring wrote:
> …
> > +++ b/mm/zswap.c
> > @@ -749,8 +749,8 @@ static int zswap_cpu_comp_prepare(unsigned int cpu, struct hlist_node *node)
> >
> > acomp = crypto_alloc_acomp_node(pool->tfm_name, 0, 0, cpu_to_node(cpu));
> > if (IS_ERR(acomp)) {
> …
> > + pr_err("could not alloc crypto acomp %s : %pe\n",
> > + pool->tfm_name, acomp);
> > ret = PTR_ERR(acomp);
> …
>
> Would you like to reduce the indentation for the passed parameters?
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v6.18-rc6#n110
That is the exact opposite of what this suggestion is intended to say.
Sahil, you should ignore any suggestion made to you by Markus. He has
been told many times to stop making these useless and unhelpful comments,
and yet he persists.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/3] mm/pagewalk: use min() macro instead of manual ternary
2025-11-18 10:45 ` David Laight
@ 2025-11-18 15:18 ` Matthew Wilcox
2025-11-18 16:56 ` David Laight
0 siblings, 1 reply; 16+ messages in thread
From: Matthew Wilcox @ 2025-11-18 15:18 UTC (permalink / raw)
To: David Laight
Cc: Sahil Chandna, akpm, david, lorenzo.stoakes, mhocko, vbabka,
rppt, surenb, hannes, shakeel.butt, zhengqi.arch, Liam.Howlett,
weixugc, axelrasmussen, yuanchu, yosry.ahmed, nphamcs,
chengming.zhou, linux-mm, linux-kernel
On Tue, Nov 18, 2025 at 10:45:37AM +0000, David Laight wrote:
> On Tue, 18 Nov 2025 11:38:49 +0530
> Sahil Chandna <chandna.sahil@gmail.com> wrote:
> > +++ b/mm/pagewalk.c
> > @@ -313,7 +313,7 @@ static unsigned long hugetlb_entry_end(struct hstate *h, unsigned long addr,
> > unsigned long end)
> > {
> > unsigned long boundary = (addr & huge_page_mask(h)) + huge_page_size(h);
> > - return boundary < end ? boundary : end;
> > + return min(boundary, end);
>
> You can remove the temporary:
> return min((addr & huge_page_mask(h)) + huge_page_size(h), end);
You can, but I'm not sure that's better. What would be better is:
unsigned long boundary = (addr | ~huge_page_mask(h)) + 1;
return min(boundary, end);
if you insist, we could do:
return min((addr | ~huge_page_mask(h)) + 1, end);
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 3/3] mm/zswap: use %pe to print PTR_ERR() values
2025-11-18 6:08 ` [PATCH 3/3] mm/zswap: " Sahil Chandna
2025-11-18 13:20 ` Markus Elfring
@ 2025-11-18 15:46 ` Yosry Ahmed
2025-11-19 1:50 ` SeongJae Park
2025-11-19 12:50 ` Nhat Pham
3 siblings, 0 replies; 16+ messages in thread
From: Yosry Ahmed @ 2025-11-18 15:46 UTC (permalink / raw)
To: Sahil Chandna
Cc: akpm, david, lorenzo.stoakes, mhocko, vbabka, rppt, surenb,
hannes, shakeel.butt, zhengqi.arch, Liam.Howlett, weixugc,
axelrasmussen, yuanchu, nphamcs, chengming.zhou, linux-mm,
linux-kernel
On Tue, Nov 18, 2025 at 11:38:51AM +0530, Sahil Chandna wrote:
> Use the %pe printk format specifier to report error pointers directly
> instead of printing PTR_ERR() as a long value. This improves clarity,
> produces more readable error messages.
>
> This instance was flagged by the Coccinelle script
> (misc/ptr_err_to_pe.cocci) as an opportunity to adopt %pe.
>
> Found by: make coccicheck MODE=report M=mm/
> No functional change intended.
>
> Signed-off-by: Sahil Chandna <chandna.sahil@gmail.com>
Acked-by: Yosry Ahmed <yosry.ahmed@linux.dev>
> ---
> mm/zswap.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/zswap.c b/mm/zswap.c
> index c1af782e54ec..c35604db32ad 100644
> --- a/mm/zswap.c
> +++ b/mm/zswap.c
> @@ -749,8 +749,8 @@ static int zswap_cpu_comp_prepare(unsigned int cpu, struct hlist_node *node)
>
> acomp = crypto_alloc_acomp_node(pool->tfm_name, 0, 0, cpu_to_node(cpu));
> if (IS_ERR(acomp)) {
> - pr_err("could not alloc crypto acomp %s : %ld\n",
> - pool->tfm_name, PTR_ERR(acomp));
> + pr_err("could not alloc crypto acomp %s : %pe\n",
> + pool->tfm_name, acomp);
> ret = PTR_ERR(acomp);
> goto fail;
> }
> --
> 2.50.1
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/3] mm/pagewalk: use min() macro instead of manual ternary
2025-11-18 15:18 ` Matthew Wilcox
@ 2025-11-18 16:56 ` David Laight
0 siblings, 0 replies; 16+ messages in thread
From: David Laight @ 2025-11-18 16:56 UTC (permalink / raw)
To: Matthew Wilcox
Cc: Sahil Chandna, akpm, david, lorenzo.stoakes, mhocko, vbabka,
rppt, surenb, hannes, shakeel.butt, zhengqi.arch, Liam.Howlett,
weixugc, axelrasmussen, yuanchu, yosry.ahmed, nphamcs,
chengming.zhou, linux-mm, linux-kernel
On Tue, 18 Nov 2025 15:18:50 +0000
Matthew Wilcox <willy@infradead.org> wrote:
> On Tue, Nov 18, 2025 at 10:45:37AM +0000, David Laight wrote:
> > On Tue, 18 Nov 2025 11:38:49 +0530
> > Sahil Chandna <chandna.sahil@gmail.com> wrote:
> > > +++ b/mm/pagewalk.c
> > > @@ -313,7 +313,7 @@ static unsigned long hugetlb_entry_end(struct hstate *h, unsigned long addr,
> > > unsigned long end)
> > > {
> > > unsigned long boundary = (addr & huge_page_mask(h)) + huge_page_size(h);
> > > - return boundary < end ? boundary : end;
> > > + return min(boundary, end);
> >
> > You can remove the temporary:
> > return min((addr & huge_page_mask(h)) + huge_page_size(h), end);
>
> You can, but I'm not sure that's better. What would be better is:
>
> unsigned long boundary = (addr | ~huge_page_mask(h)) + 1;
> return min(boundary, end);
>
> if you insist, we could do:
>
> return min((addr | ~huge_page_mask(h)) + 1, end);
Indeed...
David
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 3/3] mm/zswap: use %pe to print PTR_ERR() values
2025-11-18 15:11 ` Matthew Wilcox
@ 2025-11-18 19:28 ` Markus Elfring
0 siblings, 0 replies; 16+ messages in thread
From: Markus Elfring @ 2025-11-18 19:28 UTC (permalink / raw)
To: Matthew Wilcox, linux-mm
Cc: Sahil Chandna, LKML, Andrew Morton, Axel Rasmussen,
Chengming Zhou, David Hildenbrand, Johannes Weiner,
Liam R. Howlett, Lorenzo Stoakes, Michal Hocko, Mike Rapoport,
Nhat Pham, Qi Zheng, Shakeel Butt, Suren Baghdasaryan,
Vlastimil Babka, Wei Xu, Yosry Ahmed, Yuanchu Xie
>>> +++ b/mm/zswap.c
>>> @@ -749,8 +749,8 @@ static int zswap_cpu_comp_prepare(unsigned int cpu, struct hlist_node *node)
>>>
>>> acomp = crypto_alloc_acomp_node(pool->tfm_name, 0, 0, cpu_to_node(cpu));
>>> if (IS_ERR(acomp)) {
>> …
>>> + pr_err("could not alloc crypto acomp %s : %pe\n",
>>> + pool->tfm_name, acomp);
>>> ret = PTR_ERR(acomp);
>> …
>>
>> Would you like to reduce the indentation for the passed parameters?
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v6.18-rc6#n110
>
> That is the exact opposite of what this suggestion is intended to say.
I wonder about the interpretation of the provided information in such a direction.
> Sahil, you should ignore any suggestion made to you by Markus.
Do you try to distract from reminders according to a known information source here?
Regards,
Markus
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 3/3] mm/zswap: use %pe to print PTR_ERR() values
2025-11-18 6:08 ` [PATCH 3/3] mm/zswap: " Sahil Chandna
2025-11-18 13:20 ` Markus Elfring
2025-11-18 15:46 ` Yosry Ahmed
@ 2025-11-19 1:50 ` SeongJae Park
2025-11-19 12:50 ` Nhat Pham
3 siblings, 0 replies; 16+ messages in thread
From: SeongJae Park @ 2025-11-19 1:50 UTC (permalink / raw)
To: Sahil Chandna
Cc: SeongJae Park, akpm, david, lorenzo.stoakes, mhocko, vbabka,
rppt, surenb, hannes, shakeel.butt, zhengqi.arch, Liam.Howlett,
weixugc, axelrasmussen, yuanchu, yosry.ahmed, nphamcs,
chengming.zhou, linux-mm, linux-kernel
On Tue, 18 Nov 2025 11:38:51 +0530 Sahil Chandna <chandna.sahil@gmail.com> wrote:
> Use the %pe printk format specifier to report error pointers directly
> instead of printing PTR_ERR() as a long value. This improves clarity,
> produces more readable error messages.
>
> This instance was flagged by the Coccinelle script
> (misc/ptr_err_to_pe.cocci) as an opportunity to adopt %pe.
>
> Found by: make coccicheck MODE=report M=mm/
> No functional change intended.
>
> Signed-off-by: Sahil Chandna <chandna.sahil@gmail.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Thanks,
SJ
[...]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 2/3] mm/vmscan: use %pe to print PTR_ERR() values
2025-11-18 6:08 ` [PATCH 2/3] mm/vmscan: use %pe to print PTR_ERR() values Sahil Chandna
2025-11-18 13:15 ` Markus Elfring
@ 2025-11-19 1:52 ` SeongJae Park
1 sibling, 0 replies; 16+ messages in thread
From: SeongJae Park @ 2025-11-19 1:52 UTC (permalink / raw)
To: Sahil Chandna
Cc: SeongJae Park, akpm, david, lorenzo.stoakes, mhocko, vbabka,
rppt, surenb, hannes, shakeel.butt, zhengqi.arch, Liam.Howlett,
weixugc, axelrasmussen, yuanchu, yosry.ahmed, nphamcs,
chengming.zhou, linux-mm, linux-kernel
On Tue, 18 Nov 2025 11:38:50 +0530 Sahil Chandna <chandna.sahil@gmail.com> wrote:
> Use the %pe printk format specifier to report error pointers directly
> instead of printing PTR_ERR() as a long value. This improves clarity,
> produces more readable error messages.
>
> This instance was flagged by the Coccinelle script
> (misc/ptr_err_to_pe.cocci) as an opportunity to adopt %pe.
>
> Found by: make coccicheck MODE=report M=mm/
> No functional change intended
>
> Signed-off-by: Sahil Chandna <chandna.sahil@gmail.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Thanks,
SJ
[...]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 3/3] mm/zswap: use %pe to print PTR_ERR() values
2025-11-18 6:08 ` [PATCH 3/3] mm/zswap: " Sahil Chandna
` (2 preceding siblings ...)
2025-11-19 1:50 ` SeongJae Park
@ 2025-11-19 12:50 ` Nhat Pham
3 siblings, 0 replies; 16+ messages in thread
From: Nhat Pham @ 2025-11-19 12:50 UTC (permalink / raw)
To: Sahil Chandna
Cc: akpm, david, lorenzo.stoakes, mhocko, vbabka, rppt, surenb,
hannes, shakeel.butt, zhengqi.arch, Liam.Howlett, weixugc,
axelrasmussen, yuanchu, yosry.ahmed, chengming.zhou, linux-mm,
linux-kernel
On Tue, Nov 18, 2025 at 6:09 AM Sahil Chandna <chandna.sahil@gmail.com> wrote:
>
> Use the %pe printk format specifier to report error pointers directly
> instead of printing PTR_ERR() as a long value. This improves clarity,
> produces more readable error messages.
>
> This instance was flagged by the Coccinelle script
> (misc/ptr_err_to_pe.cocci) as an opportunity to adopt %pe.
>
> Found by: make coccicheck MODE=report M=mm/
> No functional change intended.
>
> Signed-off-by: Sahil Chandna <chandna.sahil@gmail.com>
Acked-by: Nhat Pham <nphamcs@gmail.com>
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2025-11-19 12:50 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-18 6:08 [PATCH 0/3] mm: Coccinelle-driven cleanups across memory management code Sahil Chandna
2025-11-18 6:08 ` [PATCH 1/3] mm/pagewalk: use min() macro instead of manual ternary Sahil Chandna
2025-11-18 10:19 ` Markus Elfring
2025-11-18 10:45 ` David Laight
2025-11-18 15:18 ` Matthew Wilcox
2025-11-18 16:56 ` David Laight
2025-11-18 6:08 ` [PATCH 2/3] mm/vmscan: use %pe to print PTR_ERR() values Sahil Chandna
2025-11-18 13:15 ` Markus Elfring
2025-11-19 1:52 ` SeongJae Park
2025-11-18 6:08 ` [PATCH 3/3] mm/zswap: " Sahil Chandna
2025-11-18 13:20 ` Markus Elfring
2025-11-18 15:11 ` Matthew Wilcox
2025-11-18 19:28 ` Markus Elfring
2025-11-18 15:46 ` Yosry Ahmed
2025-11-19 1:50 ` SeongJae Park
2025-11-19 12:50 ` Nhat Pham
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox