linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [TRIVIAL PATCH 00/26] treewide: Add and use vsprintf extension %pSR
@ 2012-12-12 18:18 Joe Perches
  2012-12-12 18:19 ` [TRIVIAL PATCH 11/26] powerpc: Convert print_symbol to %pSR Joe Perches
  0 siblings, 1 reply; 5+ messages in thread
From: Joe Perches @ 2012-12-12 18:18 UTC (permalink / raw)
  To: Jiri Kosina, linux-doc, linuxppc-dev, cbe-oss-dev, linux-edac,
	user-mode-linux-devel, user-mode-linux-user, cluster-devel,
	linux-mm
  Cc: linux-m32r-ja, linux-s390, linux-m32r, linux-ia64, linux-c6x-dev,
	linux-sh, linux-xtensa, linux, linux-kernel, linux-am33-list,
	linux-kernel, linux-alpha, linux-arm-kernel

Remove the somewhat awkward uses of print_symbol and convert all the
existing uses to a new vsprintf pointer type of %pSR.

print_symbol can be interleaved when it is used in a sequence like:

	printk("something: ...");
	print_symbol("%s", addr);
	printk("\n");

Instead use:

	printk("something: %pSR\n", (void *)addr);

Add a new %p[SsFf]R vsprintf extension that can perform the same
symbol function/address/offset formatting as print_symbol to
reduce the number and styles of message logging functions.

print_symbol used __builtin_extract_return_addr for those architectures
like S/390 and SPARC that have offset or masked addressing.
%p[FfSs]R uses the same gcc __builtin

Joe Perches (26):
  vsprintf: Add extension %pSR - print_symbol replacement
  alpha: Convert print_symbol to %pSR
  arm: Convert print_symbol to %pSR
  arm64: Convert print_symbol to %pSR
  avr32: Convert print_symbol to %pSR
  c6x: Convert print_symbol to %pSR
  ia64: Convert print_symbol to %pSR
  m32r: Convert print_symbol to %pSR
  mn10300: Convert print_symbol to %pSR
  openrisc: Convert print_symbol to %pSR
  powerpc: Convert print_symbol to %pSR
  s390: Convert print_symbol to %pSR
  sh: Convert print_symbol to %pSR
  um: Convert print_symbol to %pSR
  unicore32: Convert print_symbol to %pSR
  x86: Convert print_symbol to %pSR
  xtensa: Convert print_symbol to %pSR
  drivers: base: Convert print_symbol to %pSR
  gfs2: Convert print_symbol to %pSR
  sysfs: Convert print_symbol to %pSR
  irq: Convert print_symbol to %pSR
  smp_processor_id: Convert print_symbol to %pSR
  mm: Convert print_symbol to %pSR
  xtensa: Convert print_symbol to %pSR
  x86: head_64.S: Use vsprintf extension %pSR not print_symbol
  kallsyms: Remove print_symbol

 Documentation/filesystems/sysfs.txt         |    4 +-
 Documentation/printk-formats.txt            |    2 +
 Documentation/zh_CN/filesystems/sysfs.txt   |    4 +-
 arch/alpha/kernel/traps.c                   |    8 ++----
 arch/arm/kernel/process.c                   |    4 +-
 arch/arm64/kernel/process.c                 |    4 +-
 arch/avr32/kernel/process.c                 |   25 ++++++-----------------
 arch/c6x/kernel/traps.c                     |    3 +-
 arch/ia64/kernel/process.c                  |   13 ++++-------
 arch/m32r/kernel/traps.c                    |    6 +---
 arch/mn10300/kernel/traps.c                 |    8 +++---
 arch/openrisc/kernel/traps.c                |    7 +----
 arch/powerpc/platforms/cell/spu_callbacks.c |   12 ++++------
 arch/s390/kernel/traps.c                    |   28 +++++++++++++++-----------
 arch/sh/kernel/process_32.c                 |    4 +-
 arch/um/kernel/sysrq.c                      |    6 +---
 arch/unicore32/kernel/process.c             |    5 ++-
 arch/x86/kernel/cpu/mcheck/mce.c            |   13 ++++++-----
 arch/x86/kernel/dumpstack.c                 |    5 +--
 arch/x86/kernel/head_64.S                   |    4 +-
 arch/x86/kernel/process_32.c                |    2 +-
 arch/x86/mm/mmio-mod.c                      |    4 +-
 arch/x86/um/sysrq_32.c                      |    9 ++-----
 arch/xtensa/kernel/traps.c                  |    6 +---
 drivers/base/core.c                         |    4 +-
 fs/gfs2/glock.c                             |    4 +-
 fs/gfs2/trans.c                             |    3 +-
 fs/sysfs/file.c                             |    4 +-
 include/linux/kallsyms.h                    |   18 -----------------
 kernel/irq/debug.h                          |   15 ++++++-------
 kernel/kallsyms.c                           |   11 ----------
 lib/smp_processor_id.c                      |    2 +-
 lib/vsprintf.c                              |   18 ++++++++++++----
 mm/memory.c                                 |    8 +++---
 mm/slab.c                                   |    8 ++----
 35 files changed, 117 insertions(+), 164 deletions(-)

-- 
1.7.8.112.g3fd21

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

* [TRIVIAL PATCH 11/26] powerpc: Convert print_symbol to %pSR
  2012-12-12 18:18 [TRIVIAL PATCH 00/26] treewide: Add and use vsprintf extension %pSR Joe Perches
@ 2012-12-12 18:19 ` Joe Perches
  2012-12-13 11:58   ` Arnd Bergmann
  0 siblings, 1 reply; 5+ messages in thread
From: Joe Perches @ 2012-12-12 18:19 UTC (permalink / raw)
  To: Jiri Kosina, Arnd Bergmann
  Cc: cbe-oss-dev, Paul Mackerras, linuxppc-dev, linux-kernel

Use the new vsprintf extension to avoid any possible
message interleaving.

Convert the #ifdef DEBUG block to a single pr_debug.

Signed-off-by: Joe Perches <joe@perches.com>
---
 arch/powerpc/platforms/cell/spu_callbacks.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/platforms/cell/spu_callbacks.c b/arch/powerpc/platforms/cell/spu_callbacks.c
index 75d6133..c5fe6d2 100644
--- a/arch/powerpc/platforms/cell/spu_callbacks.c
+++ b/arch/powerpc/platforms/cell/spu_callbacks.c
@@ -60,13 +60,11 @@ long spu_sys_callback(struct spu_syscall_block *s)
 
 	syscall = spu_syscall_table[s->nr_ret];
 
-#ifdef DEBUG
-	print_symbol(KERN_DEBUG "SPU-syscall %s:", (unsigned long)syscall);
-	printk("syscall%ld(%lx, %lx, %lx, %lx, %lx, %lx)\n",
-			s->nr_ret,
-			s->parm[0], s->parm[1], s->parm[2],
-			s->parm[3], s->parm[4], s->parm[5]);
-#endif
+	pr_debug("SPU-syscall %pSR:syscall%ld(%lx, %lx, %lx, %lx, %lx, %lx)\n",
+		 syscall,
+		 s->nr_ret,
+		 s->parm[0], s->parm[1], s->parm[2],
+		 s->parm[3], s->parm[4], s->parm[5]);
 
 	return syscall(s->parm[0], s->parm[1], s->parm[2],
 		       s->parm[3], s->parm[4], s->parm[5]);
-- 
1.7.8.112.g3fd21

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

* Re: [TRIVIAL PATCH 11/26] powerpc: Convert print_symbol to %pSR
  2012-12-12 18:19 ` [TRIVIAL PATCH 11/26] powerpc: Convert print_symbol to %pSR Joe Perches
@ 2012-12-13 11:58   ` Arnd Bergmann
  2013-01-10  5:48     ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2012-12-13 11:58 UTC (permalink / raw)
  To: Joe Perches
  Cc: cbe-oss-dev, Jiri Kosina, linux-kernel, Paul Mackerras,
	linuxppc-dev

On Wednesday 12 December 2012, Joe Perches wrote:
> Use the new vsprintf extension to avoid any possible
> message interleaving.
> 
> Convert the #ifdef DEBUG block to a single pr_debug.
> 
> Signed-off-by: Joe Perches <joe@perches.com>

nice cleanup!

Acked-by: Arnd Bergmann <arnd@arndb.de>

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

* Re: [TRIVIAL PATCH 11/26] powerpc: Convert print_symbol to %pSR
  2012-12-13 11:58   ` Arnd Bergmann
@ 2013-01-10  5:48     ` Benjamin Herrenschmidt
  2013-01-10 17:00       ` Joe Perches
  0 siblings, 1 reply; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2013-01-10  5:48 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: cbe-oss-dev, Jiri Kosina, linux-kernel, Paul Mackerras,
	Joe Perches, linuxppc-dev

On Thu, 2012-12-13 at 11:58 +0000, Arnd Bergmann wrote:
> On Wednesday 12 December 2012, Joe Perches wrote:
> > Use the new vsprintf extension to avoid any possible
> > message interleaving.
> > 
> > Convert the #ifdef DEBUG block to a single pr_debug.
> > 
> > Signed-off-by: Joe Perches <joe@perches.com>
> 
> nice cleanup!

 ... which also breaks the build :-(

> Acked-by: Arnd Bergmann <arnd@arndb.de>

I'll fix it up locally.

Ben.

> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [TRIVIAL PATCH 11/26] powerpc: Convert print_symbol to %pSR
  2013-01-10  5:48     ` Benjamin Herrenschmidt
@ 2013-01-10 17:00       ` Joe Perches
  0 siblings, 0 replies; 5+ messages in thread
From: Joe Perches @ 2013-01-10 17:00 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: cbe-oss-dev, Jiri Kosina, Arnd Bergmann, linux-kernel,
	Paul Mackerras, linuxppc-dev

On Thu, 2013-01-10 at 16:48 +1100, Benjamin Herrenschmidt wrote:
> On Thu, 2012-12-13 at 11:58 +0000, Arnd Bergmann wrote:
> > On Wednesday 12 December 2012, Joe Perches wrote:
> > > Use the new vsprintf extension to avoid any possible
> > > message interleaving.
> > > 
> > > Convert the #ifdef DEBUG block to a single pr_debug.
> > > 
> > > Signed-off-by: Joe Perches <joe@perches.com>
> > 
> > nice cleanup!
> 
>  ... which also breaks the build :-(
> 
> > Acked-by: Arnd Bergmann <arnd@arndb.de>
> 
> I'll fix it up locally.

OK, I didn't compile it.
How does it break the build?

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

end of thread, other threads:[~2013-01-10 17:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-12 18:18 [TRIVIAL PATCH 00/26] treewide: Add and use vsprintf extension %pSR Joe Perches
2012-12-12 18:19 ` [TRIVIAL PATCH 11/26] powerpc: Convert print_symbol to %pSR Joe Perches
2012-12-13 11:58   ` Arnd Bergmann
2013-01-10  5:48     ` Benjamin Herrenschmidt
2013-01-10 17:00       ` Joe Perches

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).