linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/39] Cleanup WARN #defines
@ 2010-10-30 21:08 Joe Perches
  2010-10-30 21:08 ` [PATCH 04/39] arch/powerpc: Update WARN uses Joe Perches
  0 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2010-10-30 21:08 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: linux-fbdev, alsa-devel, dri-devel, socketcan-core, linux-mm,
	devel, linux1394-devel, devel, linux-scsi, linux-acpi, linux-pm,
	linux-media, linux-arch, intel-gfx, linux-tegra, linux-omap,
	linux-arm-kernel, discuss, linux-nfs, netdev, linux-usb,
	linux-wireless, linux-kernel, linux-alpha, linux-fsdevel,
	linuxppc-dev

WARN uses sometimes use KERN_<level> but mostly don't
have any prefix.

Change the WARN macros and the warn_slowpath function to preface
KERN_WARNING and remove all the KERN_<level> uses from WARN sites.

Neatening clean up of include/asm-generic/bug.h

Update WARN macros
Add KERN_WARNING to WARN output
Remove any KERN_<level> from WARN uses
Coalesce formats
Align WARN arguments
Add some missing newlines to WARN uses
Add some missing first test argument (1, fmt, args) to WARN uses

Joe Perches (39):
  include/asm-generic/bug.h: Update WARN macros
  arch/alpha: Update WARN uses
  arch/arm: Update WARN uses
  arch/powerpc: Update WARN uses
  arch/x86: Update WARN uses
  drivers/acpi: Update WARN uses
  drivers/base: Update WARN uses
  drivers/block: Update WARN uses
  drivers/cpuidle: Update WARN uses
  drivers/firewire: Update WARN uses
  drivers/firmware: Update WARN uses
  drivers/gpio: Update WARN uses
  drivers/gpu/drm: Update WARN uses
  drivers/media/video: Update WARN uses
  drivers/mfd: Update WARN uses
  drivers/net/can: Update WARN uses
  drivers/net/usb: Update WARN uses
  drivers/net/wireless/iwlwifi: Update WARN uses
  drivers/regulator: Update WARN uses
  drivers/scsi/fcoe: Update WARN uses
  drivers/staging: Update WARN uses
  drivers/usb/musb: Update WARN uses
  drivers/video/omap2/dss: Update WARN uses
  fs/nfsd: Update WARN uses
  fs/notify/inotify: Update WARN uses
  fs/sysfs: Update WARN uses
  fs/proc: Update WARN uses
  fs: Update WARN uses
  include/linux/device.h: Update WARN uses
  kernel/irq: Update WARN uses
  kernel/panic.c: Update warn_slowpath to use %pV
  kernel: Update WARN uses
  lib: Update WARN uses
  mm: Update WARN uses
  net/core/dev.c: Update WARN uses
  net/ipv4/tcp.c: Update WARN uses
  net/mac80211: Update WARN uses
  net/rfkill/input.c: Update WARN uses
  sound/soc/codecs/wm_hubs.c: Update WARN uses

 arch/alpha/kernel/pci-sysfs.c                |   14 ++--
 arch/arm/mach-davinci/clock.c                |    4 +-
 arch/arm/mach-davinci/da830.c                |    2 +-
 arch/arm/mach-davinci/da850.c                |   12 ++--
 arch/arm/mach-omap2/clkt_clksel.c            |   12 ++--
 arch/arm/mach-omap2/clock.c                  |   16 ++--
 arch/arm/mach-omap2/devices.c                |    4 +-
 arch/arm/mach-omap2/omap_hwmod.c             |   47 +++++++-----
 arch/arm/mach-omap2/pm34xx.c                 |    7 +-
 arch/arm/mach-omap2/serial.c                 |    2 +-
 arch/arm/mach-omap2/timer-gp.c               |    3 +-
 arch/arm/mach-tegra/clock.c                  |    3 +-
 arch/arm/mach-tegra/timer.c                  |    2 +-
 arch/arm/mach-u300/padmux.c                  |   14 +---
 arch/arm/plat-omap/omap-pm-noop.c            |   10 ++--
 arch/powerpc/kernel/hw_breakpoint.c          |    4 +-
 arch/x86/kernel/acpi/boot.c                  |    2 +-
 arch/x86/kernel/apic/apic.c                  |    2 +-
 arch/x86/kernel/apic/es7000_32.c             |    2 +-
 arch/x86/kernel/cpu/perf_event.c             |    4 +-
 arch/x86/kernel/pci-calgary_64.c             |    4 +-
 arch/x86/kernel/tsc_sync.c                   |    4 +-
 arch/x86/kernel/xsave.c                      |    2 +-
 arch/x86/mm/ioremap.c                        |    5 +-
 arch/x86/mm/pageattr-test.c                  |    2 +-
 arch/x86/mm/pageattr.c                       |    5 +-
 arch/x86/platform/sfi/sfi.c                  |    4 +-
 drivers/acpi/ec.c                            |    4 +-
 drivers/base/class.c                         |    4 +-
 drivers/base/core.c                          |    5 +-
 drivers/base/memory.c                        |    4 +-
 drivers/base/sys.c                           |   10 +--
 drivers/block/floppy.c                       |    2 +-
 drivers/cpuidle/driver.c                     |    2 +-
 drivers/firewire/core-transaction.c          |    6 +-
 drivers/firmware/dmi_scan.c                  |    2 +-
 drivers/gpio/gpiolib.c                       |    4 +-
 drivers/gpio/it8761e_gpio.c                  |    2 +-
 drivers/gpu/drm/drm_crtc_helper.c            |    2 +-
 drivers/gpu/drm/i915/i915_gem.c              |    3 +-
 drivers/gpu/drm/radeon/evergreen.c           |    2 +-
 drivers/gpu/drm/radeon/r100.c                |    4 +-
 drivers/gpu/drm/radeon/r300.c                |    2 +-
 drivers/gpu/drm/radeon/r600.c                |    4 +-
 drivers/gpu/drm/radeon/radeon_fence.c        |    3 +-
 drivers/gpu/drm/radeon/radeon_ttm.c          |    3 +-
 drivers/gpu/drm/radeon/rs400.c               |    2 +-
 drivers/gpu/drm/radeon/rs600.c               |    4 +-
 drivers/media/video/s5p-fimc/fimc-core.c     |    2 +-
 drivers/media/video/sr030pc30.c              |    2 +-
 drivers/mfd/ezx-pcap.c                       |    5 +-
 drivers/net/can/mscan/mscan.c                |    2 +-
 drivers/net/usb/ipheth.c                     |    2 +-
 drivers/net/wireless/iwlwifi/iwl-agn-lib.c   |    3 +-
 drivers/net/wireless/iwlwifi/iwl-agn-sta.c   |    6 +-
 drivers/net/wireless/iwlwifi/iwl-tx.c        |    6 +-
 drivers/net/wireless/iwlwifi/iwl3945-base.c  |    2 +-
 drivers/regulator/core.c                     |    3 +-
 drivers/scsi/fcoe/libfcoe.c                  |    2 +-
 drivers/staging/memrar/memrar_allocator.c    |    2 +-
 drivers/staging/solo6x10/solo6010-v4l2-enc.c |    2 +-
 drivers/usb/musb/musb_host.c                 |    6 +-
 drivers/video/omap2/dss/core.c               |    3 +-
 fs/bio.c                                     |    2 +-
 fs/buffer.c                                  |    2 +-
 fs/nfsd/nfs4state.c                          |    3 +-
 fs/notify/inotify/inotify_fsnotify.c         |    4 +-
 fs/proc/generic.c                            |    9 +--
 fs/super.c                                   |    5 +-
 fs/sysfs/dir.c                               |    3 +-
 fs/sysfs/file.c                              |    4 +-
 fs/sysfs/group.c                             |    4 +-
 fs/sysfs/symlink.c                           |   10 +--
 include/asm-generic/bug.h                    |  101 ++++++++++++++++----------
 include/linux/device.h                       |    2 +-
 kernel/irq/chip.c                            |    2 +-
 kernel/irq/manage.c                          |    2 +-
 kernel/notifier.c                            |    2 +-
 kernel/panic.c                               |   40 +++++------
 kernel/pm_qos_params.c                       |    6 +-
 lib/debugobjects.c                           |   21 +++---
 lib/iomap.c                                  |    2 +-
 lib/kobject.c                                |    9 +--
 lib/kobject_uevent.c                         |    4 +-
 lib/list_debug.c                             |   24 +++----
 lib/plist.c                                  |   12 ++--
 mm/percpu.c                                  |    4 +-
 mm/vmalloc.c                                 |    5 +-
 net/core/dev.c                               |    3 +-
 net/ipv4/tcp.c                               |   16 ++---
 net/mac80211/agg-tx.c                        |    5 +-
 net/mac80211/iface.c                         |    4 +-
 net/mac80211/mlme.c                          |    2 +-
 net/mac80211/rx.c                            |    4 +-
 net/mac80211/tx.c                            |    4 +-
 net/mac80211/util.c                          |    4 +-
 net/mac80211/work.c                          |    4 +-
 net/rfkill/input.c                           |    5 +-
 sound/soc/codecs/wm_hubs.c                   |    2 +-
 99 files changed, 319 insertions(+), 330 deletions(-)

-- 
1.7.3.1.g432b3.dirty

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 04/39] arch/powerpc: Update WARN uses
  2010-10-30 21:08 [PATCH 00/39] Cleanup WARN #defines Joe Perches
@ 2010-10-30 21:08 ` Joe Perches
  2010-11-01 11:02   ` Michael Ellerman
  0 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2010-10-30 21:08 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: Paul Mackerras, linuxppc-dev, linux-kernel

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);
 		perf_event_disable(bp);
 		goto out;
 	}
-- 
1.7.3.1.g432b3.dirty

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 04/39] arch/powerpc: Update WARN uses
  2010-10-30 21:08 ` [PATCH 04/39] arch/powerpc: Update WARN uses Joe Perches
@ 2010-11-01 11:02   ` Michael Ellerman
  2010-11-01 14:41     ` Joe Perches
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Ellerman @ 2010-11-01 11:02 UTC (permalink / raw)
  To: Joe Perches; +Cc: Paul Mackerras, Jiri Kosina, linuxppc-dev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1045 bytes --]

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


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 04/39] arch/powerpc: Update WARN uses
  2010-11-01 11:02   ` Michael Ellerman
@ 2010-11-01 14:41     ` Joe Perches
  2010-11-02  0:26       ` Michael Ellerman
  0 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2010-11-01 14:41 UTC (permalink / raw)
  To: michael; +Cc: Paul Mackerras, Jiri Kosina, linuxppc-dev, linux-kernel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 04/39] arch/powerpc: Update WARN uses
  2010-11-01 14:41     ` Joe Perches
@ 2010-11-02  0:26       ` Michael Ellerman
  2010-11-02  1:50         ` Joe Perches
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Ellerman @ 2010-11-02  0:26 UTC (permalink / raw)
  To: Joe Perches; +Cc: Paul Mackerras, Jiri Kosina, linuxppc-dev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1799 bytes --]

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



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 04/39] arch/powerpc: Update WARN uses
  2010-11-02  0:26       ` Michael Ellerman
@ 2010-11-02  1:50         ` Joe Perches
  2010-11-02  3:20           ` Michael Ellerman
  0 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2010-11-02  1:50 UTC (permalink / raw)
  To: michael; +Cc: Paul Mackerras, Jiri Kosina, linuxppc-dev, linux-kernel

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"

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 04/39] arch/powerpc: Update WARN uses
  2010-11-02  1:50         ` Joe Perches
@ 2010-11-02  3:20           ` Michael Ellerman
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Ellerman @ 2010-11-02  3:20 UTC (permalink / raw)
  To: Joe Perches; +Cc: Paul Mackerras, Jiri Kosina, linuxppc-dev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 716 bytes --]

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

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-11-02  3:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-30 21:08 [PATCH 00/39] Cleanup WARN #defines Joe Perches
2010-10-30 21:08 ` [PATCH 04/39] arch/powerpc: Update WARN uses Joe Perches
2010-11-01 11:02   ` Michael Ellerman
2010-11-01 14:41     ` Joe Perches
2010-11-02  0:26       ` Michael Ellerman
2010-11-02  1:50         ` Joe Perches
2010-11-02  3:20           ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).