* [PATCH] block: partitions: Use seq_buf_putc() in cmdline_partition()
@ 2026-06-25 8:08 Markus Elfring
2026-06-25 8:18 ` Andy Shevchenko
2026-06-26 16:48 ` Markus Elfring
0 siblings, 2 replies; 6+ messages in thread
From: Markus Elfring @ 2026-06-25 8:08 UTC (permalink / raw)
To: linux-block, Jens Axboe, Josh Law, Kees Cook
Cc: LKML, kernel-janitors, Andy Shevchenko, Woradorn Laodhanadhaworn
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 25 Jun 2026 09:50:33 +0200
A single line break should be put into a sequence buffer.
Thus use the corresponding function “seq_buf_putc”.
The source code was transformed by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
All affected source code places could be adjusted at once
if the change acceptance would evolve accordingly.
18 source files are left over for similar development considerations.
block/partitions/cmdline.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/block/partitions/cmdline.c b/block/partitions/cmdline.c
index 4fd52ed154b4..ce7488b3d2db 100644
--- a/block/partitions/cmdline.c
+++ b/block/partitions/cmdline.c
@@ -376,8 +376,6 @@ int cmdline_partition(struct parsed_partitions *state)
cmdline_parts_set(parts, disk_size, state);
cmdline_parts_verifier(1, state);
-
- seq_buf_puts(&state->pp_buf, "\n");
-
+ seq_buf_putc(&state->pp_buf, '\n');
return 1;
}
--
2.54.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] block: partitions: Use seq_buf_putc() in cmdline_partition()
2026-06-25 8:08 [PATCH] block: partitions: Use seq_buf_putc() in cmdline_partition() Markus Elfring
@ 2026-06-25 8:18 ` Andy Shevchenko
2026-06-25 12:18 ` Markus Elfring
2026-06-26 16:48 ` Markus Elfring
1 sibling, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2026-06-25 8:18 UTC (permalink / raw)
To: Markus Elfring
Cc: linux-block, Jens Axboe, Josh Law, Kees Cook, LKML,
kernel-janitors, Woradorn Laodhanadhaworn
On Thu, Jun 25, 2026 at 10:08:01AM +0200, Markus Elfring wrote:
>
> A single line break should be put into a sequence buffer.
> Thus use the corresponding function “seq_buf_putc”.
“seq_buf_putc()”.
> The source code was transformed by using the Coccinelle software.
...
> cmdline_parts_set(parts, disk_size, state);
> cmdline_parts_verifier(1, state);
> -
> - seq_buf_puts(&state->pp_buf, "\n");
> -
> + seq_buf_putc(&state->pp_buf, '\n');
Why did you remove blank lines?
> return 1;
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] block: partitions: Use seq_buf_putc() in cmdline_partition()
2026-06-25 8:18 ` Andy Shevchenko
@ 2026-06-25 12:18 ` Markus Elfring
2026-06-25 14:27 ` Andy Shevchenko
0 siblings, 1 reply; 6+ messages in thread
From: Markus Elfring @ 2026-06-25 12:18 UTC (permalink / raw)
To: Andy Shevchenko, linux-block
Cc: Jens Axboe, Josh Law, Kees Cook, Woradorn Laodhanadhaworn, LKML,
kernel-janitors
>
>> cmdline_parts_set(parts, disk_size, state);
>> cmdline_parts_verifier(1, state);
>
>> -
>> - seq_buf_puts(&state->pp_buf, "\n");
>> -
>> + seq_buf_putc(&state->pp_buf, '\n');
>
> Why did you remove blank lines?
>
>> return 1;
I imagine that this source code place can become a bit more succinct.
See also:
efi_partition()
https://elixir.bootlin.com/linux/v7.1.1/source/block/partitions/efi.c#L694-L756
Do you insist to preserve two blank lines here?
Regards,
Markus
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] block: partitions: Use seq_buf_putc() in cmdline_partition()
2026-06-25 12:18 ` Markus Elfring
@ 2026-06-25 14:27 ` Andy Shevchenko
0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2026-06-25 14:27 UTC (permalink / raw)
To: Markus Elfring
Cc: linux-block, Jens Axboe, Josh Law, Kees Cook,
Woradorn Laodhanadhaworn, LKML, kernel-janitors
On Thu, Jun 25, 2026 at 02:18:49PM +0200, Markus Elfring wrote:
...
> >> cmdline_parts_set(parts, disk_size, state);
> >> cmdline_parts_verifier(1, state);
> >
> >> -
> >> - seq_buf_puts(&state->pp_buf, "\n");
> >> -
> >> + seq_buf_putc(&state->pp_buf, '\n');
> >
> > Why did you remove blank lines?
> >
> >> return 1;
> I imagine that this source code place can become a bit more succinct.
>
> See also:
> efi_partition()
> https://elixir.bootlin.com/linux/v7.1.1/source/block/partitions/efi.c#L694-L756
>
> Do you insist to preserve two blank lines here?
Yes.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: block: partitions: Use seq_buf_putc() in cmdline_partition()
2026-06-25 8:08 [PATCH] block: partitions: Use seq_buf_putc() in cmdline_partition() Markus Elfring
2026-06-25 8:18 ` Andy Shevchenko
@ 2026-06-26 16:48 ` Markus Elfring
2026-06-27 5:30 ` Christophe JAILLET
1 sibling, 1 reply; 6+ messages in thread
From: Markus Elfring @ 2026-06-26 16:48 UTC (permalink / raw)
To: linux-block, Andy Shevchenko, Jens Axboe, Josh Law, Kees Cook
Cc: LKML, kernel-janitors, Woradorn Laodhanadhaworn
> All affected source code places could be adjusted at once
> if the change acceptance would evolve accordingly.
>
> 18 source files are left over for similar development considerations.
>
>
> block/partitions/cmdline.c | 4 +---
Will development interests grow for remaining update candidates?
See also:
Clarification approach “Using seq_buf_putc() calls more often?”
https://lore.kernel.org/cocci/3455eaa7-297f-46c9-a8ab-91e5bfbe0105@web.de/
https://sympa.inria.fr/sympa/arc/cocci/2026-06/msg00030.html
Regards,
Markus
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: block: partitions: Use seq_buf_putc() in cmdline_partition()
2026-06-26 16:48 ` Markus Elfring
@ 2026-06-27 5:30 ` Christophe JAILLET
0 siblings, 0 replies; 6+ messages in thread
From: Christophe JAILLET @ 2026-06-27 5:30 UTC (permalink / raw)
To: Markus Elfring, linux-block, Andy Shevchenko, Jens Axboe,
Josh Law, Kees Cook
Cc: LKML, kernel-janitors, Woradorn Laodhanadhaworn
Le 26/06/2026 à 18:48, Markus Elfring a écrit :
>> All affected source code places could be adjusted at once
>> if the change acceptance would evolve accordingly.
>>
>> 18 source files are left over for similar development considerations.
>>
>>
>> block/partitions/cmdline.c | 4 +---
>
> Will development interests grow for remaining update candidates?
These changes are pointless and already performed by the compiler. See [1].
So from my PoV, they only trash git blame output and make future
backport harder.
Just my 2c.
CJ
[1]:
https://elixir.bootlin.com/linux/v7.1-rc6/source/include/linux/seq_file.h#L127
>
> See also:
> Clarification approach “Using seq_buf_putc() calls more often?”
> https://lore.kernel.org/cocci/3455eaa7-297f-46c9-a8ab-91e5bfbe0105@web.de/
> https://sympa.inria.fr/sympa/arc/cocci/2026-06/msg00030.html
>
> Regards,
> Markus
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-06-27 5:31 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-25 8:08 [PATCH] block: partitions: Use seq_buf_putc() in cmdline_partition() Markus Elfring
2026-06-25 8:18 ` Andy Shevchenko
2026-06-25 12:18 ` Markus Elfring
2026-06-25 14:27 ` Andy Shevchenko
2026-06-26 16:48 ` Markus Elfring
2026-06-27 5:30 ` Christophe JAILLET
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox