2006-12-18 22:06:58

by Robert P. J. Day

[permalink] [raw]
Subject: [PATCH] ppc : Use syslog macro for the printk log level.


Use the appropriate logging macro for the priority level for that
printk call.

Signed-off-by: Robert P. J. Day <[email protected]>

---

this appears to be the only instance in the entire tree of
hard-coding the log level in a printk.


diff --git a/arch/ppc/syslib/m8260_pci_erratum9.c b/arch/ppc/syslib/m8260_pci_erratum9.c
index 5475709..041c017 100644
--- a/arch/ppc/syslib/m8260_pci_erratum9.c
+++ b/arch/ppc/syslib/m8260_pci_erratum9.c
@@ -105,7 +105,8 @@ void idma_pci9_init(void)
idma_reg[IDMA_CHAN].idmr = 0; /* mask all IDMA interrupts */
idma_reg[IDMA_CHAN].idsr = 0xff; /* clear all event flags */

- printk("<4>Using IDMA%d for MPC8260 device erratum PCI 9 workaround\n",
+ printk( KERN_WARNING
+ "Using IDMA%d for MPC8260 device erratum PCI 9 workaround\n",
IDMA_CHAN + 1);

return;


2006-12-18 23:00:07

by David Rientjes

[permalink] [raw]
Subject: Re: [PATCH] ppc : Use syslog macro for the printk log level.

Remove the remaining hard-coded printk levels.

Signed-off-by: David Rientjes <[email protected]>
---
arch/arm/lib/io-acorn.S | 4 +++-
arch/arm/vfp/vfphw.S | 8 +++++---
arch/arm26/lib/io-acorn.S | 4 +++-
drivers/isdn/i4l/isdn_bsdcomp.c | 4 ++--
drivers/net/bsd_comp.c | 4 ++--
5 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/arch/arm/lib/io-acorn.S b/arch/arm/lib/io-acorn.S
index 1b197ea..19656f1 100644
--- a/arch/arm/lib/io-acorn.S
+++ b/arch/arm/lib/io-acorn.S
@@ -13,11 +13,13 @@
#include <linux/linkage.h>
#include <asm/assembler.h>

+#define KERN_WARNING "<4>"
+
.text
.align

.Liosl_warning:
- .ascii "<4>insl/outsl not implemented, called from %08lX\0"
+ .ascii KERN_WARNING "insl/outsl not implemented, called from %08lX\0"
.align

/*
diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S
index e51e667..0dd4077 100644
--- a/arch/arm/vfp/vfphw.S
+++ b/arch/arm/vfp/vfphw.S
@@ -18,13 +18,15 @@ #include <asm/thread_info.h>
#include <asm/vfpmacros.h>
#include "../kernel/entry-header.S"

+#define KERN_DEBUG "<7>"
+
.macro DBGSTR, str
#ifdef DEBUG
stmfd sp!, {r0-r3, ip, lr}
add r0, pc, #4
bl printk
b 1f
- .asciz "<7>VFP: \str\n"
+ .asciz KERN_DEBUG "VFP: \str\n"
.balign 4
1: ldmfd sp!, {r0-r3, ip, lr}
#endif
@@ -37,7 +39,7 @@ #ifdef DEBUG
add r0, pc, #4
bl printk
b 1f
- .asciz "<7>VFP: \str\n"
+ .asciz KERN_DEBUG "VFP: \str\n"
.balign 4
1: ldmfd sp!, {r0-r3, ip, lr}
#endif
@@ -52,7 +54,7 @@ #ifdef DEBUG
add r0, pc, #4
bl printk
b 1f
- .asciz "<7>VFP: \str\n"
+ .asciz KERN_DEBUG "VFP: \str\n"
.balign 4
1: ldmfd sp!, {r0-r3, ip, lr}
#endif
diff --git a/arch/arm26/lib/io-acorn.S b/arch/arm26/lib/io-acorn.S
index 5f62ade..6547f37 100644
--- a/arch/arm26/lib/io-acorn.S
+++ b/arch/arm26/lib/io-acorn.S
@@ -11,6 +11,8 @@ #include <linux/linkage.h>
#include <asm/assembler.h>
#include <asm/hardware.h>

+#define KERN_WARNING "<4>"
+
.text
.align

@@ -40,7 +42,7 @@ #include <asm/hardware.h>
.endm

.iosl_warning:
- .ascii "<4>insl/outsl not implemented, called from %08lX\0"
+ .ascii KERN_WARNING "insl/outsl not implemented, called from %08lX\0"
.align

/*
diff --git a/drivers/isdn/i4l/isdn_bsdcomp.c b/drivers/isdn/i4l/isdn_bsdcomp.c
index a20f33b..948f514 100644
--- a/drivers/isdn/i4l/isdn_bsdcomp.c
+++ b/drivers/isdn/i4l/isdn_bsdcomp.c
@@ -430,7 +430,7 @@ #ifdef DEBUG
static unsigned short *lens_ptr(struct bsd_db *db, int idx)
{
if ((unsigned int) idx > (unsigned int) db->maxmaxcode) {
- printk (KERN_DEBUG "<9>ppp: lens_ptr(%d) > max\n", idx);
+ printk (KERN_DEBUG "ppp: lens_ptr(%d) > max\n", idx);
idx = 0;
}
return lens_ptrx (db, idx);
@@ -439,7 +439,7 @@ static unsigned short *lens_ptr(struct b
static struct bsd_dict *dict_ptr(struct bsd_db *db, int idx)
{
if ((unsigned int) idx >= (unsigned int) db->hsize) {
- printk (KERN_DEBUG "<9>ppp: dict_ptr(%d) > max\n", idx);
+ printk (KERN_DEBUG "ppp: dict_ptr(%d) > max\n", idx);
idx = 0;
}
return dict_ptrx (db, idx);
diff --git a/drivers/net/bsd_comp.c b/drivers/net/bsd_comp.c
index 7845eaf..af3f83f 100644
--- a/drivers/net/bsd_comp.c
+++ b/drivers/net/bsd_comp.c
@@ -531,7 +531,7 @@ static unsigned short *lens_ptr(struct b
{
if ((unsigned int) idx > (unsigned int) db->maxmaxcode)
{
- printk ("<9>ppp: lens_ptr(%d) > max\n", idx);
+ printk (KERN_DEBUG "ppp: lens_ptr(%d) > max\n", idx);
idx = 0;
}
return lens_ptrx (db, idx);
@@ -541,7 +541,7 @@ static struct bsd_dict *dict_ptr(struct
{
if ((unsigned int) idx >= (unsigned int) db->hsize)
{
- printk ("<9>ppp: dict_ptr(%d) > max\n", idx);
+ printk (KERN_DEBUG "ppp: dict_ptr(%d) > max\n", idx);
idx = 0;
}
return dict_ptrx (db, idx);

2006-12-21 03:37:28

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH] ppc : Use syslog macro for the printk log level.

On Mon, 18 Dec 2006 14:36:23 -0800 (PST)
David Rientjes <[email protected]> wrote:

> --- a/arch/arm/vfp/vfphw.S
> +++ b/arch/arm/vfp/vfphw.S
> @@ -18,13 +18,15 @@ #include <asm/thread_info.h>
> #include <asm/vfpmacros.h>
> #include "../kernel/entry-header.S"
>
> +#define KERN_DEBUG "<7>"
> +

These definitions should be available to assembly code via inclusion of
kernel.h?