[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAhV-H6o4FFmkOw3FQy7nW5gNuokZcweNbptSN7PTXpLJA6Vaw@mail.gmail.com>
Date: Sun, 11 Jan 2026 09:48:59 +0800
From: Huacai Chen <chenhuacai@...nel.org>
To: Joe Perches <joe@...ches.com>
Cc: George Guo <dongtai.guo@...ux.dev>, guodongtai@...inos.cn, hengqi.chen@...il.com,
kernel@...0n.name, lianyangyang@...inos.cn, linux-kernel@...r.kernel.org,
loongarch@...ts.linux.dev, r@....cc, xry111@...111.site
Subject: Re: [PATCH v10 loongarch-next 3/3] LoongArch: Replace seq_printf with
seq_puts for simple strings
Hi, Joe,
On Sun, Jan 11, 2026 at 2:04 AM Joe Perches <joe@...ches.com> wrote:
>
> On Sat, 2026-01-10 at 21:11 +0800, George Guo wrote:
> > Fix warnings like: "Prefer seq_puts to seq_printf" by checkpatch.pl.
> >
> > Replace seq_printf() calls with seq_puts() in show_cpuinfo()
> > when outputting simple constant strings without format specifiers.
> >
> > This improves performance slightly as seq_puts() avoids parsing
> > the format string.
> []
> > diff --git a/arch/loongarch/kernel/proc.c b/arch/loongarch/kernel/proc.c
> []
> > @@ -50,33 +50,49 @@ static int show_cpuinfo(struct seq_file *m, void *v)
> []
> > - seq_printf(m, "Features\t\t:");
> > - if (cpu_has_cpucfg) seq_printf(m, " cpucfg");
> > - if (cpu_has_lam) seq_printf(m, " lam");
> [etc]
> > + seq_puts(m, "Features\t\t:");
> > + if (cpu_has_cpucfg)
> > + seq_puts(m, " cpucfg");
> > + if (cpu_has_lam)
> > + seq_puts(m, " lam");
>
> trivia:
>
> Not sure this is better style as it's fairly difficult to read.
>
> Maybe a macro might help, something like:
>
> #define seq_cpu_feature(m, feature) \
> if (cpu_has_##feature) seq_puts(m, " " #feature)
>
> seq_cpu_feature(m, cpucfg);
> seq_cpu_feature(m, lam);
Seems just some bikesheedings, the current style is OK at least for
me. Since George has worked on this series for a very long time, let's
stop changing and get it merged.
Huacai
>
> etc.
>
Powered by blists - more mailing lists