lkml.org 
[lkml]   [2017]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] MIPS: kernel: proc: Remove spurious white space in cpuinfo
From
Date
On Fri, 2017-10-20 at 21:52 +0100, Maciej W. Rozycki wrote:
> On Fri, 20 Oct 2017, Joe Perches wrote:
>
> > > diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c
> > > index bd9bf52..99f9aab 100644
> > > --- a/arch/mips/kernel/proc.c
> > > +++ b/arch/mips/kernel/proc.c
> > > @@ -58,7 +58,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
> > >
> > > seq_printf(m, "processor\t\t: %ld\n", n);
> > > sprintf(fmt, "cpu model\t\t: %%s V%%d.%%d%s\n",
> > > - cpu_data[n].options & MIPS_CPU_FPU ? " FPU V%d.%d" : "");
> > > + cpu_data[n].options & MIPS_CPU_FPU ? " FPU V%d.%d" : "");
> > > seq_printf(m, fmt, __cpu_name[n],
> > > (version >> 4) & 0x0f, version & 0x0f,
> > > (fp_vers >> 4) & 0x0f, fp_vers & 0x0f);
> >
> > That's somewhat unpleasant code as it formats a fmt string
> > and the compiler can not verify fmt and args.
> >
> > Perhaps something like the below is preferable:
>
> Hmm, what problem exactly are you trying to solve with code that has
> worked just fine for 16 years now?

The compiler cannot verify fmt and args.

\
 
 \ /
  Last update: 2017-10-22 17:47    [W:0.062 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site