diff mbox

[04/39] arch/powerpc: Update WARN uses

Message ID c6c46b5924e1cc9720d3ad76e6c11e982bd661e5.1288471898.git.joe@perches.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Joe Perches Oct. 30, 2010, 9:08 p.m. UTC
Coalesce long formats.
Align arguments.
Add missing newlines.

Signed-off-by: Joe Perches <joe@perches.com>
---
 arch/powerpc/kernel/hw_breakpoint.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Michael Ellerman Nov. 1, 2010, 11:02 a.m. UTC | #1
On Sat, 2010-10-30 at 14:08 -0700, Joe Perches wrote:
> Coalesce long formats.
> Align arguments.
> Add missing newlines.
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  arch/powerpc/kernel/hw_breakpoint.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c
> index 5ecd040..d7343a7 100644
> --- a/arch/powerpc/kernel/hw_breakpoint.c
> +++ b/arch/powerpc/kernel/hw_breakpoint.c
> @@ -270,8 +270,8 @@ int __kprobes hw_breakpoint_handler(struct die_args *args)
>  	 * message to let the user know about it.
>  	 */
>  	if (!stepped) {
> -		WARN(1, "Unable to handle hardware breakpoint. Breakpoint at "
> -			"0x%lx will be disabled.", info->address);
> +		WARN(1, "Unable to handle hardware breakpoint. Breakpoint at 0x%lx will be disabled.\n",
> +		     info->address);

That appears to have done nothing other than turn a short line into one
that is now > 80 columns. Is that the latest fad?

cheers
Joe Perches Nov. 1, 2010, 2:41 p.m. UTC | #2
On Mon, 2010-11-01 at 22:02 +1100, Michael Ellerman wrote:
> On Sat, 2010-10-30 at 14:08 -0700, Joe Perches wrote:
> > Coalesce long formats.
> > Align arguments.
> > Add missing newlines.
> > 
> > Signed-off-by: Joe Perches <joe@perches.com>
> > ---
> >  arch/powerpc/kernel/hw_breakpoint.c |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c
> > index 5ecd040..d7343a7 100644
> > --- a/arch/powerpc/kernel/hw_breakpoint.c
> > +++ b/arch/powerpc/kernel/hw_breakpoint.c
> > @@ -270,8 +270,8 @@ int __kprobes hw_breakpoint_handler(struct die_args *args)
> >  	 * message to let the user know about it.
> >  	 */
> >  	if (!stepped) {
> > -		WARN(1, "Unable to handle hardware breakpoint. Breakpoint at "
> > -			"0x%lx will be disabled.", info->address);
> > +		WARN(1, "Unable to handle hardware breakpoint. Breakpoint at 0x%lx will be disabled.\n",
> > +		     info->address);
> 
> That appears to have done nothing other than turn a short line into one
> that is now > 80 columns.

Added '\n'.

The series was done for a few reasons:

o to add missing newlines at the end of messages as was done here
o to convert a couple of misuses of WARN(msg) to WARN(1, msg)
o to remove KERN_ prefixes from WARN(test, KERN_<level> msg)

>  Is that the latest fad?

Pretty much.  Format coalescing is generally preferred for grep.
Some consider it churn.

cheers, Joe
Michael Ellerman Nov. 2, 2010, 12:26 a.m. UTC | #3
On Mon, 2010-11-01 at 07:41 -0700, Joe Perches wrote:
> On Mon, 2010-11-01 at 22:02 +1100, Michael Ellerman wrote:
> > On Sat, 2010-10-30 at 14:08 -0700, Joe Perches wrote:
> > > Coalesce long formats.
> > > Align arguments.
> > > Add missing newlines.
> > > 
> > > Signed-off-by: Joe Perches <joe@perches.com>
> > > ---
> > >  arch/powerpc/kernel/hw_breakpoint.c |    4 ++--
> > >  1 files changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c
> > > index 5ecd040..d7343a7 100644
> > > --- a/arch/powerpc/kernel/hw_breakpoint.c
> > > +++ b/arch/powerpc/kernel/hw_breakpoint.c
> > > @@ -270,8 +270,8 @@ int __kprobes hw_breakpoint_handler(struct die_args *args)
> > >  	 * message to let the user know about it.
> > >  	 */
> > >  	if (!stepped) {
> > > -		WARN(1, "Unable to handle hardware breakpoint. Breakpoint at "
> > > -			"0x%lx will be disabled.", info->address);
> > > +		WARN(1, "Unable to handle hardware breakpoint. Breakpoint at 0x%lx will be disabled.\n",
> > > +		     info->address);
> > 
> > That appears to have done nothing other than turn a short line into one
> > that is now > 80 columns.
> 
> Added '\n'.

Right.

> The series was done for a few reasons:
> 
> o to add missing newlines at the end of messages as was done here
> o to convert a couple of misuses of WARN(msg) to WARN(1, msg)
> o to remove KERN_ prefixes from WARN(test, KERN_<level> msg)

All fair enough.

> >  Is that the latest fad?
> 
> Pretty much.  Format coalescing is generally preferred for grep.

Really? Grep doesn't work anyway because you have format specifiers, and
although you can try and guess them .. good luck, 0x%lx, or 0x%llx, or
%#lx or ..

cheers
Joe Perches Nov. 2, 2010, 1:50 a.m. UTC | #4
On Tue, 2010-11-02 at 11:26 +1100, Michael Ellerman wrote:
> On Mon, 2010-11-01 at 07:41 -0700, Joe Perches wrote:
> > Pretty much.  Format coalescing is generally preferred for grep.
> Really? Grep doesn't work anyway because you have format specifiers, and
> although you can try and guess them .. good luck, 0x%lx, or 0x%llx, or
> %#lx or ..

grep "Breakpoint at .* will be disabled"
Michael Ellerman Nov. 2, 2010, 3:20 a.m. UTC | #5
On Mon, 2010-11-01 at 18:50 -0700, Joe Perches wrote:
> On Tue, 2010-11-02 at 11:26 +1100, Michael Ellerman wrote:
> > On Mon, 2010-11-01 at 07:41 -0700, Joe Perches wrote:
> > > Pretty much.  Format coalescing is generally preferred for grep.
> > Really? Grep doesn't work anyway because you have format specifiers, and
> > although you can try and guess them .. good luck, 0x%lx, or 0x%llx, or
> > %#lx or ..
> 
> grep "Breakpoint at .* will be disabled"

Sure. For more mundane and repeated error strings the .* can be a pain
in that it matches too much.

But whatever, I'll start writing my code with uncollapsed string
formats, and wait for the torrent of make-it-80-columns patches :)

cheers
diff mbox

Patch

diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c
index 5ecd040..d7343a7 100644
--- a/arch/powerpc/kernel/hw_breakpoint.c
+++ b/arch/powerpc/kernel/hw_breakpoint.c
@@ -270,8 +270,8 @@  int __kprobes hw_breakpoint_handler(struct die_args *args)
 	 * message to let the user know about it.
 	 */
 	if (!stepped) {
-		WARN(1, "Unable to handle hardware breakpoint. Breakpoint at "
-			"0x%lx will be disabled.", info->address);
+		WARN(1, "Unable to handle hardware breakpoint. Breakpoint at 0x%lx will be disabled.\n",
+		     info->address);
 		perf_event_disable(bp);
 		goto out;
 	}