2020-04-27 19:03:30

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 2/3] mtd: lpddr: Replace printk with pr_notice

On Mon, 2020-04-27 at 14:03 -0500, Gustavo A. R. Silva wrote:
> pr_notice is preferred over printk.

So is coalescing formats

? diff --git a/include/linux/mtd/pfow.h b/include/linux/mtd/pfow.h
[]
> @@ -127,31 +127,31 @@ static inline void print_drs_error(unsigned dsr)
> int prog_status = (dsr & DSR_RPS) >> 8;
>
> if (!(dsr & DSR_AVAILABLE))
> - printk(KERN_NOTICE"DSR.15: (0) Device not Available\n");
> + pr_notice("DSR.15: (0) Device not Available\n");
> if ((prog_status & 0x03) == 0x03)
> - printk(KERN_NOTICE"DSR.9,8: (11) Attempt to program invalid "
> + pr_notice("DSR.9,8: (11) Attempt to program invalid "
> "half with 41h command\n");

pr_notice("DSR.9,8: (11) Attempt to program invalid half with 41h command\n");

etc...



2020-04-27 19:10:45

by Gustavo A. R. Silva

[permalink] [raw]
Subject: Re: [PATCH 2/3] mtd: lpddr: Replace printk with pr_notice



On 4/27/20 14:01, Joe Perches wrote:
> On Mon, 2020-04-27 at 14:03 -0500, Gustavo A. R. Silva wrote:
>> pr_notice is preferred over printk.
>
> So is coalescing formats
>
> ? diff --git a/include/linux/mtd/pfow.h b/include/linux/mtd/pfow.h
> []
>> @@ -127,31 +127,31 @@ static inline void print_drs_error(unsigned dsr)
>> int prog_status = (dsr & DSR_RPS) >> 8;
>>
>> if (!(dsr & DSR_AVAILABLE))
>> - printk(KERN_NOTICE"DSR.15: (0) Device not Available\n");
>> + pr_notice("DSR.15: (0) Device not Available\n");
>> if ((prog_status & 0x03) == 0x03)
>> - printk(KERN_NOTICE"DSR.9,8: (11) Attempt to program invalid "
>> + pr_notice("DSR.9,8: (11) Attempt to program invalid "
>> "half with 41h command\n");
>
> pr_notice("DSR.9,8: (11) Attempt to program invalid half with 41h command\n");
>

I didn't want to mess with the rest of format, because some maintainers
don't like that. If Miquel is OK with that, I can fix that up, too.

Thanks
--
Gustavo

2020-04-27 19:17:47

by Miquel Raynal

[permalink] [raw]
Subject: Re: [PATCH 2/3] mtd: lpddr: Replace printk with pr_notice

Hi Gustavo,

"Gustavo A. R. Silva" <[email protected]> wrote on Mon, 27 Apr
2020 14:10:36 -0500:

> On 4/27/20 14:01, Joe Perches wrote:
> > On Mon, 2020-04-27 at 14:03 -0500, Gustavo A. R. Silva wrote:
> >> pr_notice is preferred over printk.
> >
> > So is coalescing formats
> >
> > ? diff --git a/include/linux/mtd/pfow.h b/include/linux/mtd/pfow.h
> > []
> >> @@ -127,31 +127,31 @@ static inline void print_drs_error(unsigned dsr)
> >> int prog_status = (dsr & DSR_RPS) >> 8;
> >>
> >> if (!(dsr & DSR_AVAILABLE))
> >> - printk(KERN_NOTICE"DSR.15: (0) Device not Available\n");
> >> + pr_notice("DSR.15: (0) Device not Available\n");
> >> if ((prog_status & 0x03) == 0x03)
> >> - printk(KERN_NOTICE"DSR.9,8: (11) Attempt to program invalid "
> >> + pr_notice("DSR.9,8: (11) Attempt to program invalid "
> >> "half with 41h command\n");
> >
> > pr_notice("DSR.9,8: (11) Attempt to program invalid half with 41h command\n");
> >
>
> I didn't want to mess with the rest of format, because some maintainers
> don't like that. If Miquel is OK with that, I can fix that up, too.
>
> Thanks
> --
> Gustavo

I'm fine with it in this case, just mention it in the commit log,
please.

Thanks,
Miquèl

2020-04-27 19:19:06

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 2/3] mtd: lpddr: Replace printk with pr_notice

On Mon, 2020-04-27 at 14:10 -0500, Gustavo A. R. Silva wrote:
>
> On 4/27/20 14:01, Joe Perches wrote:
> > On Mon, 2020-04-27 at 14:03 -0500, Gustavo A. R. Silva wrote:
> > > pr_notice is preferred over printk.
> >
> > So is coalescing formats
> >
> > ? diff --git a/include/linux/mtd/pfow.h b/include/linux/mtd/pfow.h
> > []
> > > @@ -127,31 +127,31 @@ static inline void print_drs_error(unsigned dsr)
> > > int prog_status = (dsr & DSR_RPS) >> 8;
> > >
> > > if (!(dsr & DSR_AVAILABLE))
> > > - printk(KERN_NOTICE"DSR.15: (0) Device not Available\n");
> > > + pr_notice("DSR.15: (0) Device not Available\n");
> > > if ((prog_status & 0x03) == 0x03)
> > > - printk(KERN_NOTICE"DSR.9,8: (11) Attempt to program invalid "
> > > + pr_notice("DSR.9,8: (11) Attempt to program invalid "
> > > "half with 41h command\n");
> >
> > pr_notice("DSR.9,8: (11) Attempt to program invalid half with 41h command\n");
> >
>
> I didn't want to mess with the rest of format, because some maintainers
> don't like that. If Miquel is OK with that, I can fix that up, too.

He should. Coalescing is part of coding-style.

"never break user-visible strings such as printk messages"

cheers, Joe

2020-04-27 19:25:30

by Miquel Raynal

[permalink] [raw]
Subject: Re: [PATCH 2/3] mtd: lpddr: Replace printk with pr_notice

Hi Joe,

Joe Perches <[email protected]> wrote on Mon, 27 Apr 2020 12:15:02 -0700:

> On Mon, 2020-04-27 at 14:10 -0500, Gustavo A. R. Silva wrote:
> >
> > On 4/27/20 14:01, Joe Perches wrote:
> > > On Mon, 2020-04-27 at 14:03 -0500, Gustavo A. R. Silva wrote:
> > > > pr_notice is preferred over printk.
> > >
> > > So is coalescing formats
> > >
> > > ? diff --git a/include/linux/mtd/pfow.h b/include/linux/mtd/pfow.h
> > > []
> > > > @@ -127,31 +127,31 @@ static inline void print_drs_error(unsigned dsr)
> > > > int prog_status = (dsr & DSR_RPS) >> 8;
> > > >
> > > > if (!(dsr & DSR_AVAILABLE))
> > > > - printk(KERN_NOTICE"DSR.15: (0) Device not Available\n");
> > > > + pr_notice("DSR.15: (0) Device not Available\n");
> > > > if ((prog_status & 0x03) == 0x03)
> > > > - printk(KERN_NOTICE"DSR.9,8: (11) Attempt to program invalid "
> > > > + pr_notice("DSR.9,8: (11) Attempt to program invalid "
> > > > "half with 41h command\n");
> > >
> > > pr_notice("DSR.9,8: (11) Attempt to program invalid half with 41h command\n");
> > >
> >
> > I didn't want to mess with the rest of format, because some maintainers
> > don't like that. If Miquel is OK with that, I can fix that up, too.
>
> He should. Coalescing is part of coding-style.
>
> "never break user-visible strings such as printk messages"
>
> cheers, Joe
>

I suppose Gustavo meant that there are maintainers in the community
(and I am part of it) that do not like when people fix style issues
aside their own changes -specifically without writing it in commit
logs. But in this situation I think s/printk(KEN_NOTICE/pr_notice(/
needs the second line to be re-aligned with the first one. While
touching it, it seems reasonable to also fix this style issue and avoid
keeping broken strings.

Thanks,
Miquèl