* [PATCH 1/1] fs/ubifs/super.c: replace seq_printf by seq_puts
@ 2014-07-15 19:26 Fabian Frederick
2014-07-15 20:10 ` Richard Weinberger
2014-07-16 6:19 ` Artem Bityutskiy
0 siblings, 2 replies; 5+ messages in thread
From: Fabian Frederick @ 2014-07-15 19:26 UTC (permalink / raw)
To: linux-kernel
Cc: Fabian Frederick, Artem Bityutskiy, Adrian Hunter, Andrew Morton,
linux-mtd
Fix checkpatch warnings:
"WARNING: Prefer seq_puts to seq_printf"
Cc: Artem Bityutskiy <dedekind1@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mtd@lists.infradead.org
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
fs/ubifs/super.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 3904c85..e5bd068 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -424,19 +424,19 @@ static int ubifs_show_options(struct seq_file *s, struct dentry *root)
struct ubifs_info *c = root->d_sb->s_fs_info;
if (c->mount_opts.unmount_mode == 2)
- seq_printf(s, ",fast_unmount");
+ seq_puts(s, ",fast_unmount");
else if (c->mount_opts.unmount_mode == 1)
- seq_printf(s, ",norm_unmount");
+ seq_puts(s, ",norm_unmount");
if (c->mount_opts.bulk_read == 2)
- seq_printf(s, ",bulk_read");
+ seq_puts(s, ",bulk_read");
else if (c->mount_opts.bulk_read == 1)
- seq_printf(s, ",no_bulk_read");
+ seq_puts(s, ",no_bulk_read");
if (c->mount_opts.chk_data_crc == 2)
- seq_printf(s, ",chk_data_crc");
+ seq_puts(s, ",chk_data_crc");
else if (c->mount_opts.chk_data_crc == 1)
- seq_printf(s, ",no_chk_data_crc");
+ seq_puts(s, ",no_chk_data_crc");
if (c->mount_opts.override_compr) {
seq_printf(s, ",compr=%s",
--
1.8.4.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] fs/ubifs/super.c: replace seq_printf by seq_puts
2014-07-15 19:26 [PATCH 1/1] fs/ubifs/super.c: replace seq_printf by seq_puts Fabian Frederick
@ 2014-07-15 20:10 ` Richard Weinberger
2014-07-15 20:59 ` Andrew Morton
2014-07-16 6:19 ` Artem Bityutskiy
1 sibling, 1 reply; 5+ messages in thread
From: Richard Weinberger @ 2014-07-15 20:10 UTC (permalink / raw)
To: Fabian Frederick
Cc: LKML, Artem Bityutskiy, Adrian Hunter, Andrew Morton,
linux-mtd@lists.infradead.org
On Tue, Jul 15, 2014 at 9:26 PM, Fabian Frederick <fabf@skynet.be> wrote:
> Fix checkpatch warnings:
> "WARNING: Prefer seq_puts to seq_printf"
Can you explain why seq_puts() is preferred over seq_printf()?
> Cc: Artem Bityutskiy <dedekind1@gmail.com>
> Cc: Adrian Hunter <adrian.hunter@intel.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: linux-mtd@lists.infradead.org
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
> fs/ubifs/super.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
> index 3904c85..e5bd068 100644
> --- a/fs/ubifs/super.c
> +++ b/fs/ubifs/super.c
> @@ -424,19 +424,19 @@ static int ubifs_show_options(struct seq_file *s, struct dentry *root)
> struct ubifs_info *c = root->d_sb->s_fs_info;
>
> if (c->mount_opts.unmount_mode == 2)
> - seq_printf(s, ",fast_unmount");
> + seq_puts(s, ",fast_unmount");
> else if (c->mount_opts.unmount_mode == 1)
> - seq_printf(s, ",norm_unmount");
> + seq_puts(s, ",norm_unmount");
>
> if (c->mount_opts.bulk_read == 2)
> - seq_printf(s, ",bulk_read");
> + seq_puts(s, ",bulk_read");
> else if (c->mount_opts.bulk_read == 1)
> - seq_printf(s, ",no_bulk_read");
> + seq_puts(s, ",no_bulk_read");
>
> if (c->mount_opts.chk_data_crc == 2)
> - seq_printf(s, ",chk_data_crc");
> + seq_puts(s, ",chk_data_crc");
> else if (c->mount_opts.chk_data_crc == 1)
> - seq_printf(s, ",no_chk_data_crc");
> + seq_puts(s, ",no_chk_data_crc");
>
> if (c->mount_opts.override_compr) {
> seq_printf(s, ",compr=%s",
> --
> 1.8.4.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
Thanks,
//richard
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] fs/ubifs/super.c: replace seq_printf by seq_puts
2014-07-15 20:10 ` Richard Weinberger
@ 2014-07-15 20:59 ` Andrew Morton
2014-07-15 21:02 ` Richard Weinberger
0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2014-07-15 20:59 UTC (permalink / raw)
To: Richard Weinberger
Cc: Fabian Frederick, LKML, Artem Bityutskiy, Adrian Hunter,
linux-mtd@lists.infradead.org
On Tue, 15 Jul 2014 22:10:24 +0200 Richard Weinberger <richard.weinberger@gmail.com> wrote:
> On Tue, Jul 15, 2014 at 9:26 PM, Fabian Frederick <fabf@skynet.be> wrote:
> > Fix checkpatch warnings:
> > "WARNING: Prefer seq_puts to seq_printf"
>
> Can you explain why seq_puts() is preferred over seq_printf()?
- puts is presumably faster
- puts doesn't go rogue if you accidentally pass it a "%".
- this patch actually made fs/ubifs/super.o 12 bytes smaller.
Perhaps because seq_printf() is a varargs function, forcing the
caller to pass args on the stack instead of in registers.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] fs/ubifs/super.c: replace seq_printf by seq_puts
2014-07-15 20:59 ` Andrew Morton
@ 2014-07-15 21:02 ` Richard Weinberger
0 siblings, 0 replies; 5+ messages in thread
From: Richard Weinberger @ 2014-07-15 21:02 UTC (permalink / raw)
To: Andrew Morton
Cc: Fabian Frederick, LKML, Artem Bityutskiy, Adrian Hunter,
linux-mtd@lists.infradead.org
Am 15.07.2014 22:59, schrieb Andrew Morton:
> On Tue, 15 Jul 2014 22:10:24 +0200 Richard Weinberger <richard.weinberger@gmail.com> wrote:
>
>> On Tue, Jul 15, 2014 at 9:26 PM, Fabian Frederick <fabf@skynet.be> wrote:
>>> Fix checkpatch warnings:
>>> "WARNING: Prefer seq_puts to seq_printf"
>>
>> Can you explain why seq_puts() is preferred over seq_printf()?
>
> - puts is presumably faster
>
> - puts doesn't go rogue if you accidentally pass it a "%".
>
> - this patch actually made fs/ubifs/super.o 12 bytes smaller.
> Perhaps because seq_printf() is a varargs function, forcing the
> caller to pass args on the stack instead of in registers.
This needs to go into the commit message. :-)
Thanks,
//richard
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] fs/ubifs/super.c: replace seq_printf by seq_puts
2014-07-15 19:26 [PATCH 1/1] fs/ubifs/super.c: replace seq_printf by seq_puts Fabian Frederick
2014-07-15 20:10 ` Richard Weinberger
@ 2014-07-16 6:19 ` Artem Bityutskiy
1 sibling, 0 replies; 5+ messages in thread
From: Artem Bityutskiy @ 2014-07-16 6:19 UTC (permalink / raw)
To: Fabian Frederick; +Cc: linux-kernel, Adrian Hunter, Andrew Morton, linux-mtd
On Tue, 2014-07-15 at 21:26 +0200, Fabian Frederick wrote:
> Fix checkpatch warnings:
> "WARNING: Prefer seq_puts to seq_printf"
Applied to linux-ubifs.git, added Andrew's comments there, thanks.
--
Best Regards,
Artem Bityutskiy
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-07-16 6:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-15 19:26 [PATCH 1/1] fs/ubifs/super.c: replace seq_printf by seq_puts Fabian Frederick
2014-07-15 20:10 ` Richard Weinberger
2014-07-15 20:59 ` Andrew Morton
2014-07-15 21:02 ` Richard Weinberger
2014-07-16 6:19 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox