m68k: Modernize printing of kernel messages
Subsystems (5)
Geert Uytterhoeven
maintainercover m68k: Modernize printing of kernel messages
Hi all,
This patch series modernizes the printing of kernel messages in the m68k architecture core, which is mainly about converting from printk() to pr_*().
The trigger for (finally) doing this was the user-visible breakage caused by commit 4bcc595ccd80decb ("printk: reinstate KERN_CONT for printing continuation lines").
I had hoped to sent this series much earlier, to be still included in v4.9, but that didn't happen due to lack of time. Fortunately v4.9 will be an LTS(I) kernel, so the first three patches (tagged with a "Fixes" tag) will hopefully make it to v4.9.x later ;-)
Compile-tested with my standard set of configs.
Boot-tested on ARAnyM.
Thanks for your comments!
Geert Uytterhoeven (22):
m68k/atari: Modernize printing of kernel messages m68k/mac: macints - Modernize printing of kernel messages m68k/mac: via - Modernize printing of kernel messages m68k/68000: Modernize printing of kernel messages m68k/bvme6000: Modernize printing of kernel messages m68k/coldfire: Modernize printing of kernel messages m68k/mac: baboon - Modernize printing of kernel messages m68k/mac: iop - Modernize printing of kernel messages m68k/mac: oss - Modernize printing of kernel messages m68k/mac: psc - Modernize printing of kernel messages m68k/mac: Modernize printing of kernel messages m68k/mvme147: Modernize printing of kernel messages m68k/mvme16x: Modernize printing of kernel messages m68k/q40: Modernize printing of kernel messages m68k/sun3: Modernize printing of kernel messages m68k/sun3x: Modernize printing of kernel messages m68k/kernel: Modernize printing of kernel messages m68k/mm: kmap - Modernize printing of kernel messages m68k/mm: motorola - Modernize printing of kernel messages m68k/mm: sun3 - Modernize printing of kernel messages m68k/mm: Modernize printing of kernel messages m68k/include: Modernize printing of kernel messages
arch/m68k/68000/m68328.c | 6 +- arch/m68k/68000/m68EZ328.c | 6 +- arch/m68k/68000/m68VZ328.c | 6 +- arch/m68k/atari/atakeyb.c | 14 ++--- arch/m68k/atari/config.c | 56 +++++++++--------- arch/m68k/bvme6000/config.c | 8 +-- arch/m68k/bvme6000/rtc.c | 2 +- arch/m68k/coldfire/m528x.c | 4 +- arch/m68k/coldfire/sltimers.c | 4 +- arch/m68k/coldfire/timers.c | 4 +- arch/m68k/coldfire/vectors.c | 2 +- arch/m68k/include/asm/bug.h | 4 +- arch/m68k/include/asm/dma.h | 98 +++++++++++--------------------- arch/m68k/include/asm/floppy.h | 6 +- arch/m68k/include/asm/math-emu.h | 10 ++-- arch/m68k/include/asm/mcf_pgtable.h | 9 +-- arch/m68k/include/asm/motorola_pgtable.h | 6 +- arch/m68k/include/asm/sun3_pgtable.h | 6 +- arch/m68k/include/asm/sun3xflop.h | 14 ++--- arch/m68k/kernel/dma.c | 4 +- arch/m68k/kernel/module.c | 12 ++-- arch/m68k/kernel/process.c | 20 +++---- arch/m68k/kernel/signal.c | 24 +++----- arch/m68k/kernel/uboot.c | 3 +- arch/m68k/mac/baboon.c | 22 ++++--- arch/m68k/mac/config.c | 34 ++++++----- arch/m68k/mac/iop.c | 69 ++++++++++------------ arch/m68k/mac/macints.c | 42 +++++++------- arch/m68k/mac/misc.c | 8 +-- arch/m68k/mac/oss.c | 26 +++++---- arch/m68k/mac/psc.c | 32 +++++------ arch/m68k/mac/via.c | 54 +++++++++--------- arch/m68k/mm/init.c | 2 +- arch/m68k/mm/kmap.c | 26 ++++----- arch/m68k/mm/memory.c | 4 +- arch/m68k/mm/motorola.c | 32 ++++------- arch/m68k/mm/sun3kmap.c | 5 +- arch/m68k/mvme147/config.c | 2 +- arch/m68k/mvme16x/config.c | 32 +++++------ arch/m68k/mvme16x/rtc.c | 2 +- arch/m68k/q40/config.c | 14 ++--- arch/m68k/q40/q40ints.c | 15 +++-- arch/m68k/sun3/config.c | 2 +- arch/m68k/sun3/dvma.c | 3 +- arch/m68k/sun3/idprom.c | 8 ++- arch/m68k/sun3/mmu_emu.c | 47 +++++++-------- arch/m68k/sun3/prom/printf.c | 2 +- arch/m68k/sun3/sun3dvma.c | 51 +++++++---------- arch/m68k/sun3x/dvma.c | 35 +++++------- arch/m68k/sun3x/prom.c | 4 +- 50 files changed, 412 insertions(+), 489 deletions(-)
Signature · 12 lines
1.9.1
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus TorvaldsGeert Uytterhoeven
maintainerPATCH 1/22 m68k/atari: Modernize printing of kernel messages
- Convert from printk() to pr_*(),
- Add missing continuations, to fix user-visible breakage,
- Drop useless WARNING prefix,
- Move trailing spaces to start of continuations.
--- arch/m68k/atari/atakeyb.c | 14 ++++++------ arch/m68k/atari/config.c | 56 +++++++++++++++++++++++------------------------ 2 files changed, 35 insertions(+), 35 deletions(-)
arch/m68k/atari/atakeyb.c +7 -7
@@ -149,7 +149,7 @@ static irqreturn_t atari_keyboard_interrupt(int irq, void *dummy)if (acia_stat &ACIA_OVRN ) {/* a very fast typist or a slow system, give a warning */ /* ...happens often if interrupts were disabled for too long */ -printk (KERN_DEBUG "Keyboard overrun\n" ); +pr_debug ("Keyboard overrun\n" ); scancode = acia.key_data;if (ikbd_self_test)/* During self test, don't do resyncing, just process the code */
@@ -228,14 +228,14 @@ static irqreturn_t atari_keyboard_interrupt(int irq, void *dummy) keytyp =KTYP (keyval) -0xf0 ; keyval =KVAL (keyval); -printk (KERN_WARNING "Key with scancode %d " , scancode); +pr_warn ("Key with scancode %d " , scancode);if (keytyp ==KT_LATIN || keytyp ==KT_LETTER ) {if (keyval <' ' ) -printk ("('^%c') " , keyval +'@' ); +pr_cont ("('^%c') " , keyval +'@' );else -printk ("('%c') " , keyval); +pr_cont ("('%c') " , keyval); } -printk ("is broken -- will be ignored.\n" ); +pr_cont ("is broken -- will be ignored.\n" );break ; }else if (test_bit (scancode, broken_keys))break ;
@@ -299,7 +299,7 @@ static irqreturn_t atari_keyboard_interrupt(int irq, void *dummy)#endif if (acia_stat & (ACIA_FE |ACIA_PE )) { -printk ("Error in keyboard communication\n" ); +pr_err ("Error in keyboard communication\n" ); }/* handle_scancode() can take a lot of time, so check again if
@@ -553,7 +553,7 @@ int atari_keyb_init(void)barrier ();/* if not incremented: no 0xf1 received */ if (ikbd_self_test ==1 ) -printk (KERN_ERR "WARNING: keyboard self test failed!\n" ); +pr_err ("Keyboard self test failed!\n" ); ikbd_self_test =0 ;ikbd_mouse_disable ();
arch/m68k/atari/config.c +28 -28
163 lines not on this page · raw message
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 1/22 m68k/atari: Modernize printing of kernel messages
In reply to Geert Uytterhoeven - Convert from printk() to pr_*(),
- Add missing continuations, to fix user-visible breakage,
- Drop useless WARNING prefix,
- Move trailing spaces to start of continuations.
--- arch/m68k/atari/atakeyb.c | 14 ++++++------ arch/m68k/atari/config.c | 56 +++++++++++++++++++++++------------------------ 2 files changed, 35 insertions(+), 35 deletions(-)
arch/m68k/atari/atakeyb.c +7 -7
@@ -149,7 +149,7 @@ static irqreturn_t atari_keyboard_interrupt(int irq, void *dummy)if (acia_stat &ACIA_OVRN ) {/* a very fast typist or a slow system, give a warning */ /* ...happens often if interrupts were disabled for too long */ -printk (KERN_DEBUG "Keyboard overrun\n" ); +pr_debug ("Keyboard overrun\n" ); scancode = acia.key_data;if (ikbd_self_test)/* During self test, don't do resyncing, just process the code */
@@ -228,14 +228,14 @@ static irqreturn_t atari_keyboard_interrupt(int irq, void *dummy) keytyp =KTYP (keyval) -0xf0 ; keyval =KVAL (keyval); -printk (KERN_WARNING "Key with scancode %d " , scancode); +pr_warn ("Key with scancode %d " , scancode);if (keytyp ==KT_LATIN || keytyp ==KT_LETTER ) {if (keyval <' ' ) -printk ("('^%c') " , keyval +'@' ); +pr_cont ("('^%c') " , keyval +'@' );else -printk ("('%c') " , keyval); +pr_cont ("('%c') " , keyval); } -printk ("is broken -- will be ignored.\n" ); +pr_cont ("is broken -- will be ignored.\n" );break ; }else if (test_bit (scancode, broken_keys))break ;
@@ -299,7 +299,7 @@ static irqreturn_t atari_keyboard_interrupt(int irq, void *dummy)#endif if (acia_stat & (ACIA_FE |ACIA_PE )) { -printk ("Error in keyboard communication\n" ); +pr_err ("Error in keyboard communication\n" ); }/* handle_scancode() can take a lot of time, so check again if
@@ -553,7 +553,7 @@ int atari_keyb_init(void)barrier ();/* if not incremented: no 0xf1 received */ if (ikbd_self_test ==1 ) -printk (KERN_ERR "WARNING: keyboard self test failed!\n" ); +pr_err ("Keyboard self test failed!\n" ); ikbd_self_test =0 ;ikbd_mouse_disable ();
arch/m68k/atari/config.c +28 -28
163 lines not on this page · raw message
Signature · 1 line
1.9.1
Re: [PATCH 01/22] m68k/atari: Modernize printing of kernel messages
Quoted 17 lines · Geert Uytterhoeven
- Convert from
printk()to pr_*(),
- Add missing continuations, to fix user-visible breakage,
- Drop useless WARNING prefix,
- Move trailing spaces to start of continuations.Fixes 4bcc595ccd80decb ("printk: reinstate KERN_CONT for printing continuation lines")Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/atari/atakeyb.c | 14 ++++++------ arch/m68k/atari/config.c | 56 +++++++++++++++++++++++------------------------ 2 files changed, 35 insertions(+), 35 deletions(-)arch/m68k/atari/atakeyb.c +0
-0
arch/m68k/atari/atakeyb.c static irqreturn_t atari_keyboard_interrupt(int irq, void *dummy) · line 155
Quoted 8 lines
arch/m68k/atari/atakeyb.c +1
-1@@ -149,7 +149,7 @@ static irqreturn_t atari_keyboard_interrupt(int irq, void *dummy)if (acia_stat &ACIA_OVRN ) {/* a very fast typist or a slow system, give a warning */ /* ...happens often if interrupts were disabled for too long */ -printk (KERN_DEBUG "Keyboard overrun\n" ); +pr_debug ("Keyboard overrun\n" ); scancode = acia.key_data;if (ikbd_self_test)/* During self test, don't do resyncing, just process the code */
This is not equivalent (unless there is a DEBUG macro definition hinding in a header file somewhere). Since the changelog doesn't mention suppressing any output, perhaps you were deceived by the questionable API, as I have been in the past (see 16b9d870a0 and d61c5427f6).
Re: [PATCH 01/22] m68k/atari: Modernize printing of kernel messages
In reply to Geert UytterhoevenQuoted 17 lines · Geert Uytterhoeven
- Convert from
printk()to pr_*(),
- Add missing continuations, to fix user-visible breakage,
- Drop useless WARNING prefix,
- Move trailing spaces to start of continuations.Fixes 4bcc595ccd80decb ("printk: reinstate KERN_CONT for printing continuation lines")Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/atari/atakeyb.c | 14 ++++++------ arch/m68k/atari/config.c | 56 +++++++++++++++++++++++------------------------ 2 files changed, 35 insertions(+), 35 deletions(-)arch/m68k/atari/atakeyb.c +0
-0
arch/m68k/atari/atakeyb.c static irqreturn_t atari_keyboard_interrupt(int irq, void *dummy) · line 155
Quoted 8 lines
arch/m68k/atari/atakeyb.c +1
-1@@ -149,7 +149,7 @@ static irqreturn_t atari_keyboard_interrupt(int irq, void *dummy)if (acia_stat &ACIA_OVRN ) {/* a very fast typist or a slow system, give a warning */ /* ...happens often if interrupts were disabled for too long */ -printk (KERN_DEBUG "Keyboard overrun\n" ); +pr_debug ("Keyboard overrun\n" ); scancode = acia.key_data;if (ikbd_self_test)/* During self test, don't do resyncing, just process the code */
This is not equivalent (unless there is a DEBUG macro definition hinding in a header file somewhere). Since the changelog doesn't mention suppressing any output, perhaps you were deceived by the questionable API, as I have been in the past (see 16b9d870a0 and d61c5427f6).
Geert Uytterhoeven
maintainerRe: [PATCH 01/22] m68k/atari: Modernize printing of kernel messages
Quoted 23 lines · Finn Thain
Quoted 22 lines · Geert Uytterhoeven
- Convert from
printk()to pr_*(),
- Add missing continuations, to fix user-visible breakage,
- Drop useless WARNING prefix,
- Move trailing spaces to start of continuations.Fixes 4bcc595ccd80decb ("printk: reinstate KERN_CONT for printing continuation lines")Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/atari/atakeyb.c | 14 ++++++------ arch/m68k/atari/config.c | 56 +++++++++++++++++++++++------------------------ 2 files changed, 35 insertions(+), 35 deletions(-)arch/m68k/atari/atakeyb.c +1
-1@@ -149,7 +149,7 @@ static irqreturn_t atari_keyboard_interrupt(int irq, void *dummy)if (acia_stat &ACIA_OVRN ) {/* a very fast typist or a slow system, give a warning */ /* ...happens often if interrupts were disabled for too long */ -printk (KERN_DEBUG "Keyboard overrun\n" ); +pr_debug ("Keyboard overrun\n" );
Quoted 8 lines
arch/m68k/atari/atakeyb.c static irqreturn_t atari_keyboard_interrupt(int irq, void *dummy) · line 155
Quoted 3 lines
arch/m68k/atari/atakeyb.c +0
-0scancode = acia.key_data;if (ikbd_self_test)/* During self test, don't do resyncing, just process the code */ This is not equivalent (unless there is a DEBUG macro definition hinding in a header file somewhere). Since the changelog doesn't mention suppressing any output, perhaps you were deceived by the questionable API, as I have been in the past (see
16b9d870a0andd61c5427f6).
This is an actual message people want to see in the kernel log, even when not debugging?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH 01/22] m68k/atari: Modernize printing of kernel messages
Quoted 33 lines · Geert Uytterhoeven
Quoted 23 lines · Finn Thain
Quoted 22 lines · Geert Uytterhoeven
- Convert from
printk()to pr_*(),
- Add missing continuations, to fix user-visible breakage,
- Drop useless WARNING prefix,
- Move trailing spaces to start of continuations.Fixes 4bcc595ccd80decb ("printk: reinstate KERN_CONT for printing continuation lines")Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/atari/atakeyb.c | 14 ++++++------ arch/m68k/atari/config.c | 56 +++++++++++++++++++++++------------------------ 2 files changed, 35 insertions(+), 35 deletions(-)arch/m68k/atari/atakeyb.c +1
-1@@ -149,7 +149,7 @@ static irqreturn_t atari_keyboard_interrupt(int irq, void *dummy)if (acia_stat &ACIA_OVRN ) {/* a very fast typist or a slow system, give a warning */ /* ...happens often if interrupts were disabled for too long */ -printk (KERN_DEBUG "Keyboard overrun\n" ); +pr_debug ("Keyboard overrun\n" );Quoted 8 lines
arch/m68k/atari/atakeyb.c static irqreturn_t atari_keyboard_interrupt(int irq, void *dummy) · line 155
Quoted 3 lines
arch/m68k/atari/atakeyb.c +0
-0scancode = acia.key_data;if (ikbd_self_test)/* During self test, don't do resyncing, just process the code */ This is not equivalent (unless there is a DEBUG macro definition hinding in a header file somewhere). Since the changelog doesn't mention suppressing any output, perhaps you were deceived by the questionable API, as I have been in the past (see
16b9d870a0andd61c5427f6).
Quoted 3 lines
This is an actual message people want to see in the kernel log, even when not debugging?
That's really a question for Atari users, of course. For my part, I think you should mention the behavioural change in the commit log.
Re: [PATCH 01/22] m68k/atari: Modernize printing of kernel messages
In reply to Geert UytterhoevenQuoted 33 lines · Geert Uytterhoeven
Quoted 23 lines · Finn Thain
Quoted 22 lines · Geert Uytterhoeven
- Convert from
printk()to pr_*(),
- Add missing continuations, to fix user-visible breakage,
- Drop useless WARNING prefix,
- Move trailing spaces to start of continuations.Fixes 4bcc595ccd80decb ("printk: reinstate KERN_CONT for printing continuation lines")Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/atari/atakeyb.c | 14 ++++++------ arch/m68k/atari/config.c | 56 +++++++++++++++++++++++------------------------ 2 files changed, 35 insertions(+), 35 deletions(-)arch/m68k/atari/atakeyb.c +1
-1@@ -149,7 +149,7 @@ static irqreturn_t atari_keyboard_interrupt(int irq, void *dummy)if (acia_stat &ACIA_OVRN ) {/* a very fast typist or a slow system, give a warning */ /* ...happens often if interrupts were disabled for too long */ -printk (KERN_DEBUG "Keyboard overrun\n" ); +pr_debug ("Keyboard overrun\n" );Quoted 8 lines
arch/m68k/atari/atakeyb.c static irqreturn_t atari_keyboard_interrupt(int irq, void *dummy) · line 155
Quoted 3 lines
arch/m68k/atari/atakeyb.c +0
-0scancode = acia.key_data;if (ikbd_self_test)/* During self test, don't do resyncing, just process the code */ This is not equivalent (unless there is a DEBUG macro definition hinding in a header file somewhere). Since the changelog doesn't mention suppressing any output, perhaps you were deceived by the questionable API, as I have been in the past (see
16b9d870a0andd61c5427f6).
Quoted 3 lines
This is an actual message people want to see in the kernel log, even when not debugging?
That's really a question for Atari users, of course. For my part, I think you should mention the behavioural change in the commit log.
Re: [PATCH 01/22] m68k/atari: Modernize printing of kernel messages
In reply to Geert UytterhoevenHi Geert,
Am 09.12.2016 um 01:22 schrieb Geert Uytterhoeven:
Quoted 33 lines · Finn Thain
Quoted 23 lines · Geert Uytterhoeven
Quoted 22 lines
- Convert from
printk()to pr_*(),
- Add missing continuations, to fix user-visible breakage,
- Drop useless WARNING prefix,
- Move trailing spaces to start of continuations.Fixes 4bcc595ccd80decb ("printk: reinstate KERN_CONT for printing continuation lines")Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/atari/atakeyb.c | 14 ++++++------ arch/m68k/atari/config.c | 56 +++++++++++++++++++++++------------------------ 2 files changed, 35 insertions(+), 35 deletions(-)arch/m68k/atari/atakeyb.c +1
-1@@ -149,7 +149,7 @@ static irqreturn_t atari_keyboard_interrupt(int irq, void *dummy)if (acia_stat &ACIA_OVRN ) {/* a very fast typist or a slow system, give a warning */ /* ...happens often if interrupts were disabled for too long */ -printk (KERN_DEBUG "Keyboard overrun\n" ); +pr_debug ("Keyboard overrun\n" );Quoted 8 lines
arch/m68k/atari/atakeyb.c static irqreturn_t atari_keyboard_interrupt(int irq, void *dummy) · line 155
Quoted 3 lines
arch/m68k/atari/atakeyb.c +0
-0scancode = acia.key_data;if (ikbd_self_test)/* During self test, don't do resyncing, just process the code */ This is not equivalent (unless there is a DEBUG macro definition hinding in a header file somewhere). Since the changelog doesn't mention suppressing any output, perhaps you were deceived by the questionable API, as I have been in the past (see
16b9d870a0andd61c5427f6).
Quoted 1 line
This is an actual message people want to see in the kernel log, even
No, it's not something people want to see - clutters up the screen, and causes even more interrupt hogging disk IO from syslogd so exacerbates the problem on slow systems.
But Finn is right in that output is now suppressed instead of given a particular log level. IMO stating that the message will now only be generated when the kernel has been compiled for debugging would be perfectly fine.
Cheers,
Michael
Quoted 17 lines
when not debugging?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 01/22] m68k/atari: Modernize printing of kernel messages
In reply to Geert UytterhoevenHi Geert,
Am 09.12.2016 um 01:22 schrieb Geert Uytterhoeven:
Quoted 33 lines · Finn Thain
Quoted 23 lines · Geert Uytterhoeven
Quoted 22 lines
- Convert from
printk()to pr_*(),
- Add missing continuations, to fix user-visible breakage,
- Drop useless WARNING prefix,
- Move trailing spaces to start of continuations.Fixes 4bcc595ccd80decb ("printk: reinstate KERN_CONT for printing continuation lines")Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/atari/atakeyb.c | 14 ++++++------ arch/m68k/atari/config.c | 56 +++++++++++++++++++++++------------------------ 2 files changed, 35 insertions(+), 35 deletions(-)arch/m68k/atari/atakeyb.c +1
-1@@ -149,7 +149,7 @@ static irqreturn_t atari_keyboard_interrupt(int irq, void *dummy)if (acia_stat &ACIA_OVRN ) {/* a very fast typist or a slow system, give a warning */ /* ...happens often if interrupts were disabled for too long */ -printk (KERN_DEBUG "Keyboard overrun\n" ); +pr_debug ("Keyboard overrun\n" );Quoted 8 lines
arch/m68k/atari/atakeyb.c static irqreturn_t atari_keyboard_interrupt(int irq, void *dummy) · line 155
Quoted 3 lines
arch/m68k/atari/atakeyb.c +0
-0scancode = acia.key_data;if (ikbd_self_test)/* During self test, don't do resyncing, just process the code */ This is not equivalent (unless there is a DEBUG macro definition hinding in a header file somewhere). Since the changelog doesn't mention suppressing any output, perhaps you were deceived by the questionable API, as I have been in the past (see
16b9d870a0andd61c5427f6).
Quoted 1 line
This is an actual message people want to see in the kernel log, even
No, it's not something people want to see - clutters up the screen, and causes even more interrupt hogging disk IO from syslogd so exacerbates the problem on slow systems.
But Finn is right in that output is now suppressed instead of given a particular log level. IMO stating that the message will now only be generated when the kernel has been compiled for debugging would be perfectly fine.
Cheers,
Michael
Quoted 17 lines
when not debugging?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Geert Uytterhoeven
maintainerRe: [PATCH 01/22] m68k/atari: Modernize printing of kernel messages
Hi Michael,
Quoted 36 lines · Michael Schmitz
Am 09.12.2016 um 01:22 schrieb Geert Uytterhoeven:
Quoted 33 lines · Finn Thain
Quoted 23 lines · Geert Uytterhoeven
Quoted 22 lines
- Convert from
printk()to pr_*(),
- Add missing continuations, to fix user-visible breakage,
- Drop useless WARNING prefix,
- Move trailing spaces to start of continuations.Fixes 4bcc595ccd80decb ("printk: reinstate KERN_CONT for printing continuation lines")Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/atari/atakeyb.c | 14 ++++++------ arch/m68k/atari/config.c | 56 +++++++++++++++++++++++------------------------ 2 files changed, 35 insertions(+), 35 deletions(-)arch/m68k/atari/atakeyb.c +1
-1@@ -149,7 +149,7 @@ static irqreturn_t atari_keyboard_interrupt(int irq, void *dummy)if (acia_stat &ACIA_OVRN ) {/* a very fast typist or a slow system, give a warning */ /* ...happens often if interrupts were disabled for too long */ -printk (KERN_DEBUG "Keyboard overrun\n" ); +pr_debug ("Keyboard overrun\n" );Quoted 8 lines
arch/m68k/atari/atakeyb.c static irqreturn_t atari_keyboard_interrupt(int irq, void *dummy) · line 155
Quoted 3 lines
arch/m68k/atari/atakeyb.c +0
-0scancode = acia.key_data;if (ikbd_self_test)/* During self test, don't do resyncing, just process the code */ This is not equivalent (unless there is a DEBUG macro definition hinding in a header file somewhere). Since the changelog doesn't mention suppressing any output, perhaps you were deceived by the questionable API, as I have been in the past (see
16b9d870a0andd61c5427f6).Quoted 1 line
This is an actual message people want to see in the kernel log, even
Quoted 8 lines
No, it's not something people want to see - clutters up the screen, and causes even more interrupt hogging disk IO from syslogd so exacerbates the problem on slow systems.
But Finn is right in that output is now suppressed instead of given a particular log level. IMO stating that the message will now only be generated when the kernel has been compiled for debugging would be perfectly fine.
Thanks, will update the commit message.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Geert Uytterhoeven
maintainerPATCH 2/22 m68k/mac: macints - Modernize printing of kernel messages
In reply to Geert Uytterhoeven - Introduce helpers for printing debug messages, incl. dummies for validating format strings when debugging is disabled,
- Convert from printk() to pr_*(),
- Add missing continuations, to fix user-visible breakage.
--- arch/m68k/mac/macints.c | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-)
arch/m68k/mac/macints.c +22 -20
@@ -135,6 +135,11 @@irqreturn_t mac_debug_handler (int ,void *);/* #define DEBUG_MACINTS */ +#ifdef DEBUG_MACINTS +#define pr_irq (fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#else +#define pr_irq (fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#endif static unsigned int mac_irq_startup (struct irq_data *);static void mac_irq_shutdown (struct irq_data *);
@@ -149,20 +154,18 @@void __init mac_init_IRQ (void ) { -#ifdef DEBUG_MACINTS -printk ("mac_init_IRQ(): Setting things up...\n" ); -#endif +pr_irq ("mac_init_IRQ(): Setting things up...\n" );m68k_setup_irq_controller (&mac_irq_chip, handle_simple_irq,IRQ_USER ,NUM_MAC_SOURCES -IRQ_USER );/* Make sure the SONIC interrupt is cleared or things get ugly */ #ifdef SHUTUP_SONIC -printk ("Killing onboard sonic... " ); +pr_info ("Killing onboard sonic... " );/* This address should hopefully be mapped already */ if (hwreg_present ((void *)(0x50f0a000 ))) { *(long *)(0x50f0a014 ) =0x7fffL ; *(long *)(0x50f0a010 ) =0L ; } -printk ("Done.\n" ); +pr_cont ("Done.\n" );#endif /* SHUTUP_SONIC */ /*
@@ -182,9 +185,7 @@ void __init mac_init_IRQ(void)if (request_irq (IRQ_AUTO_7 , mac_nmi_handler,0 ,"NMI" , mac_nmi_handler))pr_err ("Couldn't register NMI\n" ); -#ifdef DEBUG_MACINTS -printk ("mac_init_IRQ(): Done!\n" ); -#endif +pr_irq ("mac_init_IRQ(): Done!\n" ); }/*
@@ -281,7 +282,7 @@ static void mac_irq_shutdown(struct irq_data *data)irqreturn_t mac_debug_handler (int irq,void *dev_id) {if (num_debug[irq] <10 ) { -printk ("DEBUG: Unexpected IRQ %d\n" , irq); +pr_info ("DEBUG: Unexpected IRQ %d\n" , irq); num_debug[irq]++; }return IRQ_HANDLED ;
@@ -304,9 +305,9 @@ irqreturn_t mac_nmi_handler(int irq, void *dev_id)if (in_nmi ==1 ) { nmi_hold =1 ; -printk ("... pausing, press NMI to resume ..." ); +pr_info ("... pausing, press NMI to resume ..." ); }else { -printk (" ok!\n" ); +pr_cont (" ok!\n" ); nmi_hold =0 ; }
@@ -319,20 +320,21 @@ irqreturn_t mac_nmi_handler(int irq, void *dev_id)#if 0 struct pt_regs *fp =get_irq_regs ();show_state (); -printk ("PC: %08lx\nSR: %04x SP: %p\n" , fp->pc, fp->sr, fp); -printk ("d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n" , - fp->d0, fp->d1, fp->d2, fp->d3); -printk ("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n" , - fp->d4, fp->d5, fp->a0, fp->a1); +pr_info ("PC: %08lx\nSR: %04x SP: %p\n" , fp->pc, fp->sr, fp); +pr_info ("d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n" , + fp->d0, fp->d1, fp->d2, fp->d3); +pr_info ("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n" , + fp->d4, fp->d5, fp->a0, fp->a1);if (STACK_MAGIC != *(unsigned long *)current->kernel_stack_page) -printk ("Corrupted stack page\n" ); -printk ("Process %s (pid: %d, stackpage=%08lx)\n" , - current->comm, current->pid, current->kernel_stack_page); +pr_info ("Corrupted stack page\n" ); +pr_info ("Process %s (pid: %d, stackpage=%08lx)\n" , + current->comm, current->pid, + current->kernel_stack_page);if (intr_count ==1 )dump_stack ((struct frame *)fp);#else -/* printk("NMI "); */ +/* pr_info("NMI "); */ #endif } in_nmi--;
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 2/22 m68k/mac: macints - Modernize printing of kernel messages
In reply to Geert Uytterhoeven - Introduce helpers for printing debug messages, incl. dummies for validating format strings when debugging is disabled,
- Convert from printk() to pr_*(),
- Add missing continuations, to fix user-visible breakage.
--- arch/m68k/mac/macints.c | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-)
arch/m68k/mac/macints.c +22 -20
@@ -135,6 +135,11 @@irqreturn_t mac_debug_handler (int ,void *);/* #define DEBUG_MACINTS */ +#ifdef DEBUG_MACINTS +#define pr_irq (fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#else +#define pr_irq (fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#endif static unsigned int mac_irq_startup (struct irq_data *);static void mac_irq_shutdown (struct irq_data *);
@@ -149,20 +154,18 @@void __init mac_init_IRQ (void ) { -#ifdef DEBUG_MACINTS -printk ("mac_init_IRQ(): Setting things up...\n" ); -#endif +pr_irq ("mac_init_IRQ(): Setting things up...\n" );m68k_setup_irq_controller (&mac_irq_chip, handle_simple_irq,IRQ_USER ,NUM_MAC_SOURCES -IRQ_USER );/* Make sure the SONIC interrupt is cleared or things get ugly */ #ifdef SHUTUP_SONIC -printk ("Killing onboard sonic... " ); +pr_info ("Killing onboard sonic... " );/* This address should hopefully be mapped already */ if (hwreg_present ((void *)(0x50f0a000 ))) { *(long *)(0x50f0a014 ) =0x7fffL ; *(long *)(0x50f0a010 ) =0L ; } -printk ("Done.\n" ); +pr_cont ("Done.\n" );#endif /* SHUTUP_SONIC */ /*
@@ -182,9 +185,7 @@ void __init mac_init_IRQ(void)if (request_irq (IRQ_AUTO_7 , mac_nmi_handler,0 ,"NMI" , mac_nmi_handler))pr_err ("Couldn't register NMI\n" ); -#ifdef DEBUG_MACINTS -printk ("mac_init_IRQ(): Done!\n" ); -#endif +pr_irq ("mac_init_IRQ(): Done!\n" ); }/*
@@ -281,7 +282,7 @@ static void mac_irq_shutdown(struct irq_data *data)irqreturn_t mac_debug_handler (int irq,void *dev_id) {if (num_debug[irq] <10 ) { -printk ("DEBUG: Unexpected IRQ %d\n" , irq); +pr_info ("DEBUG: Unexpected IRQ %d\n" , irq); num_debug[irq]++; }return IRQ_HANDLED ;
@@ -304,9 +305,9 @@ irqreturn_t mac_nmi_handler(int irq, void *dev_id)if (in_nmi ==1 ) { nmi_hold =1 ; -printk ("... pausing, press NMI to resume ..." ); +pr_info ("... pausing, press NMI to resume ..." ); }else { -printk (" ok!\n" ); +pr_cont (" ok!\n" ); nmi_hold =0 ; }
@@ -319,20 +320,21 @@ irqreturn_t mac_nmi_handler(int irq, void *dev_id)#if 0 struct pt_regs *fp =get_irq_regs ();show_state (); -printk ("PC: %08lx\nSR: %04x SP: %p\n" , fp->pc, fp->sr, fp); -printk ("d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n" , - fp->d0, fp->d1, fp->d2, fp->d3); -printk ("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n" , - fp->d4, fp->d5, fp->a0, fp->a1); +pr_info ("PC: %08lx\nSR: %04x SP: %p\n" , fp->pc, fp->sr, fp); +pr_info ("d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n" , + fp->d0, fp->d1, fp->d2, fp->d3); +pr_info ("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n" , + fp->d4, fp->d5, fp->a0, fp->a1);if (STACK_MAGIC != *(unsigned long *)current->kernel_stack_page) -printk ("Corrupted stack page\n" ); -printk ("Process %s (pid: %d, stackpage=%08lx)\n" , - current->comm, current->pid, current->kernel_stack_page); +pr_info ("Corrupted stack page\n" ); +pr_info ("Process %s (pid: %d, stackpage=%08lx)\n" , + current->comm, current->pid, + current->kernel_stack_page);if (intr_count ==1 )dump_stack ((struct frame *)fp);#else -/* printk("NMI "); */ +/* pr_info("NMI "); */ #endif } in_nmi--;
Signature · 1 line
1.9.1
Re: [PATCH 02/22] m68k/mac: macints - Modernize printing of kernel messages
Quoted 17 lines · Geert Uytterhoeven
- Introduce helpers for printing debug messages, incl. dummies for validating format strings when debugging is disabled,
- Convert fromprintk()to pr_*(),
- Add missing continuations, to fix user-visible breakage.Fixes 4bcc595ccd80decb ("printk: reinstate KERN_CONT for printing continuation lines")Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/mac/macints.c | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-)arch/m68k/mac/macints.c +0
-0@@ -135,6 +135,11 @@irqreturn_t mac_debug_handler (int ,void *);
arch/m68k/mac/macints.c line 145
Quoted 10 lines
arch/m68k/mac/macints.c +5
-0/* #define DEBUG_MACINTS */ +#ifdef DEBUG_MACINTS +#define pr_irq (fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#else +#define pr_irq (fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#endif static unsigned int mac_irq_startup (struct irq_data *);static void mac_irq_shutdown (struct irq_data *);
I would prefer to delete all the DEBUG_MACINTS clutter.
Quoted 36 lines
arch/m68k/mac/macints.c +4
-8@@ -149,20 +154,18 @@void __init mac_init_IRQ (void ) { -#ifdef DEBUG_MACINTS -printk ("mac_init_IRQ(): Setting things up...\n" ); -#endif +pr_irq ("mac_init_IRQ(): Setting things up...\n" );m68k_setup_irq_controller (&mac_irq_chip, handle_simple_irq,IRQ_USER ,NUM_MAC_SOURCES -IRQ_USER );/* Make sure the SONIC interrupt is cleared or things get ugly */ #ifdef SHUTUP_SONIC -printk ("Killing onboard sonic... " ); +pr_info ("Killing onboard sonic... " );/* This address should hopefully be mapped already */ if (hwreg_present ((void *)(0x50f0a000 ))) { *(long *)(0x50f0a014 ) =0x7fffL ; *(long *)(0x50f0a010 ) =0L ; } -printk ("Done.\n" ); +pr_cont ("Done.\n" );#endif /* SHUTUP_SONIC */ /* @@ -182,9 +185,7 @@ void __init mac_init_IRQ(void)if (request_irq (IRQ_AUTO_7 , mac_nmi_handler,0 ,"NMI" , mac_nmi_handler))pr_err ("Couldn't register NMI\n" ); -#ifdef DEBUG_MACINTS -printk ("mac_init_IRQ(): Done!\n" ); -#endif +pr_irq ("mac_init_IRQ(): Done!\n" ); }/*
arch/m68k/mac/macints.c static void mac_irq_shutdown(struct irq_data *data) · line 288
Quoted 8 lines
arch/m68k/mac/macints.c +1
-1@@ -281,7 +282,7 @@ static void mac_irq_shutdown(struct irq_data *data)irqreturn_t mac_debug_handler (int irq,void *dev_id) {if (num_debug[irq] <10 ) { -printk ("DEBUG: Unexpected IRQ %d\n" , irq); +pr_info ("DEBUG: Unexpected IRQ %d\n" , irq); num_debug[irq]++; }return IRQ_HANDLED ;
Is this dead code?
Quoted 34 lines
arch/m68k/mac/macints.c +9
-10@@ -304,9 +305,9 @@ irqreturn_t mac_nmi_handler(int irq, void *dev_id)if (in_nmi ==1 ) { nmi_hold =1 ; -printk ("... pausing, press NMI to resume ..." ); +pr_info ("... pausing, press NMI to resume ..." ); }else { -printk (" ok!\n" ); +pr_cont (" ok!\n" ); nmi_hold =0 ; }@@ -319,20 +320,21 @@ irqreturn_t mac_nmi_handler(int irq, void *dev_id)#if 0 struct pt_regs *fp =get_irq_regs ();show_state (); -printk ("PC: %08lx\nSR: %04x SP: %p\n" , fp->pc, fp->sr, fp); -printk ("d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n" , - fp->d0, fp->d1, fp->d2, fp->d3); -printk ("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n" , - fp->d4, fp->d5, fp->a0, fp->a1); +pr_info ("PC: %08lx\nSR: %04x SP: %p\n" , fp->pc, fp->sr, fp); +pr_info ("d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n" , + fp->d0, fp->d1, fp->d2, fp->d3); +pr_info ("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n" , + fp->d4, fp->d5, fp->a0, fp->a1);if (STACK_MAGIC != *(unsigned long *)current->kernel_stack_page) -printk ("Corrupted stack page\n" ); -printk ("Process %s (pid: %d, stackpage=%08lx)\n" , - current->comm, current->pid, current->kernel_stack_page); +pr_info ("Corrupted stack page\n" ); + pr_info("Process %s (pid: %d, stackpage=%08lx)\n",
arch/m68k/mac/macints.c irqreturn_t mac_nmi_handler(int irq, void *dev_id) · line 340
Quoted 10 lines
arch/m68k/mac/macints.c +3
-1+ current->comm, current->pid, + current->kernel_stack_page);if (intr_count ==1 )dump_stack ((struct frame *)fp);#else -/* printk("NMI "); */ +/* pr_info("NMI "); */ #endif } in_nmi--;
I think it would be good to use pr_debug here instead of #if 0. But that will probably break the build... better ignore the #if 0 section for this series, until I put together a different patch?
Geert Uytterhoeven
maintainerRe: [PATCH 02/22] m68k/mac: macints - Modernize printing of kernel messages
Quoted 27 lines · Finn Thain
Quoted 25 lines · Geert Uytterhoeven
- Introduce helpers for printing debug messages, incl. dummies for validating format strings when debugging is disabled,
- Convert fromprintk()to pr_*(),
- Add missing continuations, to fix user-visible breakage.Fixes 4bcc595ccd80decb ("printk: reinstate KERN_CONT for printing continuation lines")Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/mac/macints.c | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-)arch/m68k/mac/macints.c +5
-0@@ -135,6 +135,11 @@irqreturn_t mac_debug_handler (int ,void *);/* #define DEBUG_MACINTS */ +#ifdef DEBUG_MACINTS +#define pr_irq (fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#else +#define pr_irq (fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#endif
Quoted 4 lines
arch/m68k/mac/macints.c line 145
Quoted 2 lines
arch/m68k/mac/macints.c +0
-0static unsigned int mac_irq_startup (struct irq_data *);static void mac_irq_shutdown (struct irq_data *);I would prefer to delete all the
DEBUG_MACINTSclutter.
OK, can do that.
Quoted 11 lines
arch/m68k/mac/macints.c static void mac_irq_shutdown(struct irq_data *data) · line 288
Quoted 9 lines
arch/m68k/mac/macints.c +1
-1@@ -281,7 +282,7 @@ static void mac_irq_shutdown(struct irq_data *data)irqreturn_t mac_debug_handler (int irq,void *dev_id) {if (num_debug[irq] <10 ) { -printk ("DEBUG: Unexpected IRQ %d\n" , irq); +pr_info ("DEBUG: Unexpected IRQ %d\n" , irq); num_debug[irq]++; }return IRQ_HANDLED ;Is this dead code?
Yes, mac_debug_handler() is unused.
Removing that can be done in a separate patch (this is one of the patches I'd like
to send upstream ASAP).
Quoted 28 lines
Quoted 28 lines
arch/m68k/mac/macints.c +10
-9@@ -319,20 +320,21 @@ irqreturn_t mac_nmi_handler(int irq, void *dev_id)#if 0 struct pt_regs *fp =get_irq_regs ();show_state (); -printk ("PC: %08lx\nSR: %04x SP: %p\n" , fp->pc, fp->sr, fp); -printk ("d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n" , - fp->d0, fp->d1, fp->d2, fp->d3); -printk ("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n" , - fp->d4, fp->d5, fp->a0, fp->a1); +pr_info ("PC: %08lx\nSR: %04x SP: %p\n" , fp->pc, fp->sr, fp); +pr_info ("d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n" , + fp->d0, fp->d1, fp->d2, fp->d3); +pr_info ("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n" , + fp->d4, fp->d5, fp->a0, fp->a1);if (STACK_MAGIC != *(unsigned long *)current->kernel_stack_page) -printk ("Corrupted stack page\n" ); -printk ("Process %s (pid: %d, stackpage=%08lx)\n" , - current->comm, current->pid, current->kernel_stack_page); +pr_info ("Corrupted stack page\n" ); +pr_info ("Process %s (pid: %d, stackpage=%08lx)\n" , + current->comm, current->pid, + current->kernel_stack_page);if (intr_count ==1 )dump_stack ((struct frame *)fp);#else -/* printk("NMI "); */ +/* pr_info("NMI "); */
Quoted 8 lines
arch/m68k/mac/macints.c irqreturn_t mac_nmi_handler(int irq, void *dev_id) · line 340
Quoted 4 lines
arch/m68k/mac/macints.c +0
-0#endif } in_nmi--;I think it would be good to use
pr_debughere instead of #if 0. But that will probably break the build... better ignore the #if 0 section for this series, until I put together a different patch?
Or worse, break at runtime. There's also non-printing code in that block.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH 02/22] m68k/mac: macints - Modernize printing of kernel messages
Quoted 28 lines · Geert Uytterhoeven
Quoted 27 lines · Finn Thain
Quoted 25 lines · Geert Uytterhoeven
- Introduce helpers for printing debug messages, incl. dummies for validating format strings when debugging is disabled,
- Convert fromprintk()to pr_*(),
- Add missing continuations, to fix user-visible breakage.Fixes 4bcc595ccd80decb ("printk: reinstate KERN_CONT for printing continuation lines")Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/mac/macints.c | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-)arch/m68k/mac/macints.c +5
-0@@ -135,6 +135,11 @@irqreturn_t mac_debug_handler (int ,void *);/* #define DEBUG_MACINTS */ +#ifdef DEBUG_MACINTS +#define pr_irq (fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#else +#define pr_irq (fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#endif
Quoted 6 lines
Quoted 4 lines
arch/m68k/mac/macints.c line 145
Quoted 2 lines
arch/m68k/mac/macints.c +0
-0static unsigned int mac_irq_startup (struct irq_data *);static void mac_irq_shutdown (struct irq_data *);I would prefer to delete all the
DEBUG_MACINTSclutter.OK, can do that.
Thanks.
Quoted 13 lines
Quoted 12 lines
arch/m68k/mac/macints.c static void mac_irq_shutdown(struct irq_data *data) · line 288
Quoted 10 lines
arch/m68k/mac/macints.c +1
-1@@ -281,7 +282,7 @@ static void mac_irq_shutdown(struct irq_data *data)irqreturn_t mac_debug_handler (int irq,void *dev_id) {if (num_debug[irq] <10 ) { -printk ("DEBUG: Unexpected IRQ %d\n" , irq); +pr_info ("DEBUG: Unexpected IRQ %d\n" , irq); num_debug[irq]++; }return IRQ_HANDLED ;Is this dead code?
Quoted 4 lines
Yes,
mac_debug_handler()is unused.Removing that can be done in a separate patch (this is one of the patches I'd like to send upstream ASAP).
OK.
Quoted 38 lines
Quoted 29 lines
Quoted 29 lines
arch/m68k/mac/macints.c +10
-9@@ -319,20 +320,21 @@ irqreturn_t mac_nmi_handler(int irq, void *dev_id)#if 0 struct pt_regs *fp =get_irq_regs ();show_state (); -printk ("PC: %08lx\nSR: %04x SP: %p\n" , fp->pc, fp->sr, fp); -printk ("d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n" , - fp->d0, fp->d1, fp->d2, fp->d3); -printk ("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n" , - fp->d4, fp->d5, fp->a0, fp->a1); +pr_info ("PC: %08lx\nSR: %04x SP: %p\n" , fp->pc, fp->sr, fp); +pr_info ("d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n" , + fp->d0, fp->d1, fp->d2, fp->d3); +pr_info ("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n" , + fp->d4, fp->d5, fp->a0, fp->a1);if (STACK_MAGIC != *(unsigned long *)current->kernel_stack_page) -printk ("Corrupted stack page\n" ); -printk ("Process %s (pid: %d, stackpage=%08lx)\n" , - current->comm, current->pid, current->kernel_stack_page); +pr_info ("Corrupted stack page\n" ); +pr_info ("Process %s (pid: %d, stackpage=%08lx)\n" , + current->comm, current->pid, + current->kernel_stack_page);if (intr_count ==1 )dump_stack ((struct frame *)fp);#else -/* printk("NMI "); */ +/* pr_info("NMI "); */ Quoted 8 lines
arch/m68k/mac/macints.c irqreturn_t mac_nmi_handler(int irq, void *dev_id) · line 340
Quoted 4 lines
arch/m68k/mac/macints.c +0
-0#endif } in_nmi--;I think it would be good to use
pr_debughere instead of #if 0. But that will probably break the build... better ignore the #if 0 section for this series, until I put together a different patch?
Quoted 2 lines
Or worse, break at runtime.
The NMI isn't easily tiggered, unless you know how. It's solely for developers.
Anyway, this is dead code so it makes little difference whether you patch it or not. But this hunk will break an NMI debug patch that I've been using for ten years or so. Since this code needs a rewrite anyway, you might as well avoid the churn IMHO.
Quoted 1 line
There's also non-printing code in that block.
But no side-effects, right?
Quoted 4 lines
Gr{oetje,eeting}s,
Geert
Geert Uytterhoeven
maintainerPATCH 3/22 m68k/mac: via - Modernize printing of kernel messages
In reply to Geert Uytterhoeven - Introduce helpers for printing debug messages, incl. dummies for validating format strings when debugging is disabled,
- Convert from printk() to pr_*(),
- Add missing continuations, to fix user-visible breakage,
- Drop superfluous casts.
--- arch/m68k/mac/via.c | 54 ++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-)
arch/m68k/mac/via.c +27 -27
@@ -36,6 +36,12 @@#include <asm/mac_psc.h> #include <asm/mac_oss.h> +#ifdef DEBUG_IRQUSE +#define pr_irq (fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#else +#define pr_irq (fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#endif +volatile __u8 *via1, *via2;int rbv_present;int via_alt_mapping;
@@ -168,15 +174,15 @@ void __init via_init(void)panic ("UNKNOWN VIA TYPE" ); } -printk (KERN_INFO "VIA1 at %p is a 6522 or clone\n" , via1); +pr_info ("VIA1 at %p is a 6522 or clone\n" , via1); -printk (KERN_INFO "VIA2 at %p is " , via2); +pr_info ("VIA2 at %p is " , via2);if (rbv_present) { -printk ("an RBV\n" ); +pr_cont ("an RBV\n" ); }else if (oss_present) { -printk ("an OSS\n" ); +pr_cont ("an OSS\n" ); }else { -printk ("a 6522 or clone\n" ); +pr_cont ("a 6522 or clone\n" ); }#ifdef DEBUG_VIA
@@ -299,24 +305,22 @@ void __init via_init_clock(irq_handler_t func)void via_debug_dump (void ) { -printk (KERN_DEBUG "VIA1: DDRA = 0x%02X DDRB = 0x%02X ACR = 0x%02X\n" , - (uint ) via1[vDirA], (uint ) via1[vDirB], (uint ) via1[vACR]); -printk (KERN_DEBUG " PCR = 0x%02X IFR = 0x%02X IER = 0x%02X\n" , - (uint ) via1[vPCR], (uint ) via1[vIFR], (uint ) via1[vIER]); +pr_debug ("VIA1: DDRA = 0x%02X DDRB = 0x%02X ACR = 0x%02X\n" , + via1[vDirA], via1[vDirB], via1[vACR]); +pr_debug (" PCR = 0x%02X IFR = 0x%02X IER = 0x%02X\n" , + via1[vPCR], via1[vIFR], via1[vIER]);if (oss_present) { -printk (KERN_DEBUG "VIA2: <OSS>\n" ); +pr_debug ("VIA2: <OSS>\n" ); }else if (rbv_present) { -printk (KERN_DEBUG "VIA2: IFR = 0x%02X IER = 0x%02X\n" , - (uint ) via2[rIFR], (uint ) via2[rIER]); -printk (KERN_DEBUG " SIFR = 0x%02X SIER = 0x%02X\n" , - (uint ) via2[rSIFR], (uint ) via2[rSIER]); +pr_debug ("VIA2: IFR = 0x%02X IER = 0x%02X\n" , via2[rIFR], + via2[rIER]); +pr_debug (" SIFR = 0x%02X SIER = 0x%02X\n" , via2[rSIFR], + via2[rSIER]); }else { -printk (KERN_DEBUG "VIA2: DDRA = 0x%02X DDRB = 0x%02X ACR = 0x%02X\n" , - (uint ) via2[vDirA], (uint ) via2[vDirB], - (uint ) via2[vACR]); -printk (KERN_DEBUG " PCR = 0x%02X IFR = 0x%02X IER = 0x%02X\n" , - (uint ) via2[vPCR], - (uint ) via2[vIFR], (uint ) via2[vIER]); +pr_debug ("VIA2: DDRA = 0x%02X DDRB = 0x%02X ACR = 0x%02X\n" , + via2[vDirA], via2[vDirB], via2[vACR]); +pr_debug (" PCR = 0x%02X IFR = 0x%02X IER = 0x%02X\n" , + via2[vPCR], via2[vIFR], via2[vIER]); } }
@@ -362,7 +366,7 @@ int via_get_cache_disable(void) {/* Safeguard against being called accidentally */ if (!via2) { -printk (KERN_ERR "via_get_cache_disable called on a non-VIA machine!\n" ); +pr_err ("via_get_cache_disable called on a non-VIA machine!\n" );return 1 ; }
@@ -550,9 +554,7 @@ void via_irq_enable(int irq) {int irq_src =IRQ_SRC (irq);int irq_idx =IRQ_IDX (irq); -#ifdef DEBUG_IRQUSE -printk (KERN_DEBUG "via_irq_enable(%d)\n" , irq); -#endif +pr_irq ("via_irq_enable(%d)\n" , irq);if (irq_src ==1 ) { via1[vIER] =IER_SET_BIT (irq_idx);
@@ -582,9 +584,7 @@ void via_irq_disable(int irq) {int irq_src =IRQ_SRC (irq);int irq_idx =IRQ_IDX (irq); -#ifdef DEBUG_IRQUSE -printk (KERN_DEBUG "via_irq_disable(%d)\n" , irq); -#endif +pr_irq ("via_irq_disable(%d)\n" , irq);if (irq_src ==1 ) { via1[vIER] =IER_CLR_BIT (irq_idx);
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 3/22 m68k/mac: via - Modernize printing of kernel messages
In reply to Geert Uytterhoeven - Introduce helpers for printing debug messages, incl. dummies for validating format strings when debugging is disabled,
- Convert from printk() to pr_*(),
- Add missing continuations, to fix user-visible breakage,
- Drop superfluous casts.
--- arch/m68k/mac/via.c | 54 ++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-)
arch/m68k/mac/via.c +27 -27
@@ -36,6 +36,12 @@#include <asm/mac_psc.h> #include <asm/mac_oss.h> +#ifdef DEBUG_IRQUSE +#define pr_irq (fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#else +#define pr_irq (fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#endif +volatile __u8 *via1, *via2;int rbv_present;int via_alt_mapping;
@@ -168,15 +174,15 @@ void __init via_init(void)panic ("UNKNOWN VIA TYPE" ); } -printk (KERN_INFO "VIA1 at %p is a 6522 or clone\n" , via1); +pr_info ("VIA1 at %p is a 6522 or clone\n" , via1); -printk (KERN_INFO "VIA2 at %p is " , via2); +pr_info ("VIA2 at %p is " , via2);if (rbv_present) { -printk ("an RBV\n" ); +pr_cont ("an RBV\n" ); }else if (oss_present) { -printk ("an OSS\n" ); +pr_cont ("an OSS\n" ); }else { -printk ("a 6522 or clone\n" ); +pr_cont ("a 6522 or clone\n" ); }#ifdef DEBUG_VIA
@@ -299,24 +305,22 @@ void __init via_init_clock(irq_handler_t func)void via_debug_dump (void ) { -printk (KERN_DEBUG "VIA1: DDRA = 0x%02X DDRB = 0x%02X ACR = 0x%02X\n" , - (uint ) via1[vDirA], (uint ) via1[vDirB], (uint ) via1[vACR]); -printk (KERN_DEBUG " PCR = 0x%02X IFR = 0x%02X IER = 0x%02X\n" , - (uint ) via1[vPCR], (uint ) via1[vIFR], (uint ) via1[vIER]); +pr_debug ("VIA1: DDRA = 0x%02X DDRB = 0x%02X ACR = 0x%02X\n" , + via1[vDirA], via1[vDirB], via1[vACR]); +pr_debug (" PCR = 0x%02X IFR = 0x%02X IER = 0x%02X\n" , + via1[vPCR], via1[vIFR], via1[vIER]);if (oss_present) { -printk (KERN_DEBUG "VIA2: <OSS>\n" ); +pr_debug ("VIA2: <OSS>\n" ); }else if (rbv_present) { -printk (KERN_DEBUG "VIA2: IFR = 0x%02X IER = 0x%02X\n" , - (uint ) via2[rIFR], (uint ) via2[rIER]); -printk (KERN_DEBUG " SIFR = 0x%02X SIER = 0x%02X\n" , - (uint ) via2[rSIFR], (uint ) via2[rSIER]); +pr_debug ("VIA2: IFR = 0x%02X IER = 0x%02X\n" , via2[rIFR], + via2[rIER]); +pr_debug (" SIFR = 0x%02X SIER = 0x%02X\n" , via2[rSIFR], + via2[rSIER]); }else { -printk (KERN_DEBUG "VIA2: DDRA = 0x%02X DDRB = 0x%02X ACR = 0x%02X\n" , - (uint ) via2[vDirA], (uint ) via2[vDirB], - (uint ) via2[vACR]); -printk (KERN_DEBUG " PCR = 0x%02X IFR = 0x%02X IER = 0x%02X\n" , - (uint ) via2[vPCR], - (uint ) via2[vIFR], (uint ) via2[vIER]); +pr_debug ("VIA2: DDRA = 0x%02X DDRB = 0x%02X ACR = 0x%02X\n" , + via2[vDirA], via2[vDirB], via2[vACR]); +pr_debug (" PCR = 0x%02X IFR = 0x%02X IER = 0x%02X\n" , + via2[vPCR], via2[vIFR], via2[vIER]); } }
@@ -362,7 +366,7 @@ int via_get_cache_disable(void) {/* Safeguard against being called accidentally */ if (!via2) { -printk (KERN_ERR "via_get_cache_disable called on a non-VIA machine!\n" ); +pr_err ("via_get_cache_disable called on a non-VIA machine!\n" );return 1 ; }
@@ -550,9 +554,7 @@ void via_irq_enable(int irq) {int irq_src =IRQ_SRC (irq);int irq_idx =IRQ_IDX (irq); -#ifdef DEBUG_IRQUSE -printk (KERN_DEBUG "via_irq_enable(%d)\n" , irq); -#endif +pr_irq ("via_irq_enable(%d)\n" , irq);if (irq_src ==1 ) { via1[vIER] =IER_SET_BIT (irq_idx);
@@ -582,9 +584,7 @@ void via_irq_disable(int irq) {int irq_src =IRQ_SRC (irq);int irq_idx =IRQ_IDX (irq); -#ifdef DEBUG_IRQUSE -printk (KERN_DEBUG "via_irq_disable(%d)\n" , irq); -#endif +pr_irq ("via_irq_disable(%d)\n" , irq);if (irq_src ==1 ) { via1[vIER] =IER_CLR_BIT (irq_idx);
Signature · 1 line
1.9.1
Re: [PATCH 03/22] m68k/mac: via - Modernize printing of kernel messages
Quoted 19 lines · Geert Uytterhoeven
- Introduce helpers for printing debug messages, incl. dummies for validating format strings when debugging is disabled,
- Convert fromprintk()to pr_*(),
- Add missing continuations, to fix user-visible breakage,
- Drop superfluous casts.Fixes 4bcc595ccd80decb ("printk: reinstate KERN_CONT for printing continuation lines")Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/mac/via.c | 54 ++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-)arch/m68k/mac/via.c +0
-0@@ -36,6 +36,12 @@#include <asm/mac_psc.h> #include <asm/mac_oss.h>
arch/m68k/mac/via.c line 47
Quoted 10 lines
arch/m68k/mac/via.c +6
-0+#ifdef DEBUG_IRQUSE +#define pr_irq (fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#else +#define pr_irq (fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#endif +volatile __u8 *via1, *via2;int rbv_present;int via_alt_mapping;
I'd prefer to drop the DEBUG_IRQUSE macro and the debug output it controls.
Quoted 49 lines
arch/m68k/mac/via.c +14
-17@@ -168,15 +174,15 @@ void __init via_init(void)panic ("UNKNOWN VIA TYPE" ); } -printk (KERN_INFO "VIA1 at %p is a 6522 or clone\n" , via1); +pr_info ("VIA1 at %p is a 6522 or clone\n" , via1); -printk (KERN_INFO "VIA2 at %p is " , via2); +pr_info ("VIA2 at %p is " , via2);if (rbv_present) { -printk ("an RBV\n" ); +pr_cont ("an RBV\n" ); }else if (oss_present) { -printk ("an OSS\n" ); +pr_cont ("an OSS\n" ); }else { -printk ("a 6522 or clone\n" ); +pr_cont ("a 6522 or clone\n" ); }#ifdef DEBUG_VIA @@ -299,24 +305,22 @@ void __init via_init_clock(irq_handler_t func)void via_debug_dump (void ) { -printk (KERN_DEBUG "VIA1: DDRA = 0x%02X DDRB = 0x%02X ACR = 0x%02X\n" , - (uint ) via1[vDirA], (uint ) via1[vDirB], (uint ) via1[vACR]); -printk (KERN_DEBUG " PCR = 0x%02X IFR = 0x%02X IER = 0x%02X\n" , - (uint ) via1[vPCR], (uint ) via1[vIFR], (uint ) via1[vIER]); +pr_debug ("VIA1: DDRA = 0x%02X DDRB = 0x%02X ACR = 0x%02X\n" , + via1[vDirA], via1[vDirB], via1[vACR]); +pr_debug (" PCR = 0x%02X IFR = 0x%02X IER = 0x%02X\n" , + via1[vPCR], via1[vIFR], via1[vIER]);if (oss_present) { -printk (KERN_DEBUG "VIA2: <OSS>\n" ); +pr_debug ("VIA2: <OSS>\n" ); }else if (rbv_present) { -printk (KERN_DEBUG "VIA2: IFR = 0x%02X IER = 0x%02X\n" , - (uint ) via2[rIFR], (uint ) via2[rIER]); -printk (KERN_DEBUG " SIFR = 0x%02X SIER = 0x%02X\n" , - (uint ) via2[rSIFR], (uint ) via2[rSIER]); +pr_debug ("VIA2: IFR = 0x%02X IER = 0x%02X\n" , via2[rIFR], + via2[rIER]); +pr_debug (" SIFR = 0x%02X SIER = 0x%02X\n" , via2[rSIFR], + via2[rSIER]); }else { -printk (KERN_DEBUG "VIA2: DDRA = 0x%02X DDRB = 0x%02X ACR = 0x%02X\n" , - (uint ) via2[vDirA], (uint ) via2[vDirB], - (uint ) via2[vACR]);
arch/m68k/mac/via.c void __init via_init_clock(irq_handler_t func) · line 326
Quoted 10 lines
arch/m68k/mac/via.c +4
-3-printk (KERN_DEBUG " PCR = 0x%02X IFR = 0x%02X IER = 0x%02X\n" , - (uint ) via2[vPCR], - (uint ) via2[vIFR], (uint ) via2[vIER]); +pr_debug ("VIA2: DDRA = 0x%02X DDRB = 0x%02X ACR = 0x%02X\n" , + via2[vDirA], via2[vDirB], via2[vACR]); +pr_debug (" PCR = 0x%02X IFR = 0x%02X IER = 0x%02X\n" , + via2[vPCR], via2[vIFR], via2[vIER]); } }
I think these should remain printk(KERN_DEBUG, ...).
Quoted 32 lines
arch/m68k/mac/via.c +3
-7@@ -362,7 +366,7 @@ int via_get_cache_disable(void) {/* Safeguard against being called accidentally */ if (!via2) { -printk (KERN_ERR "via_get_cache_disable called on a non-VIA machine!\n" ); +pr_err ("via_get_cache_disable called on a non-VIA machine!\n" );return 1 ; }@@ -550,9 +554,7 @@ void via_irq_enable(int irq) {int irq_src =IRQ_SRC (irq);int irq_idx =IRQ_IDX (irq); -#ifdef DEBUG_IRQUSE -printk (KERN_DEBUG "via_irq_enable(%d)\n" , irq); -#endif +pr_irq ("via_irq_enable(%d)\n" , irq);if (irq_src ==1 ) { via1[vIER] =IER_SET_BIT (irq_idx);@@ -582,9 +584,7 @@ void via_irq_disable(int irq) {int irq_src =IRQ_SRC (irq);int irq_idx =IRQ_IDX (irq); -#ifdef DEBUG_IRQUSE -printk (KERN_DEBUG "via_irq_disable(%d)\n" , irq); -#endif +pr_irq ("via_irq_disable(%d)\n" , irq);if (irq_src ==1 ) { via1[vIER] =IER_CLR_BIT (irq_idx);
Geert Uytterhoeven
maintainerPATCH 4/22 m68k/68000: Modernize printing of kernel messages
In reply to Geert UytterhoevenConvert from printk() to pr_*().
--- arch/m68k/68000/m68328.c | 6 +++--- arch/m68k/68000/m68EZ328.c | 6 +++--- arch/m68k/68000/m68VZ328.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-)
arch/m68k/68000/m68328.c +3 -3
@@ -45,9 +45,9 @@ void m68328_reset (void)void __init config_BSP (char *command,int len) { -printk (KERN_INFO "\n68328 support D. Jeff Dionne <[email protected]>\n" ); -printk (KERN_INFO "68328 support Kenneth Albanowski <[email protected]>\n" ); -printk (KERN_INFO "68328/Pilot support Bernhard Kuhn <[email protected]>\n" ); +pr_info ("68328 support D. Jeff Dionne <[email protected]>\n" ); +pr_info ("68328 support Kenneth Albanowski <[email protected]>\n" ); +pr_info ("68328/Pilot support Bernhard Kuhn <[email protected]>\n" ); mach_hwclk = m68328_hwclk; mach_reset = m68328_reset;
arch/m68k/68000/m68EZ328.c +3 -3
@@ -57,12 +57,12 @@ void __init config_BSP(char *command, int len) {unsigned char *p; -printk (KERN_INFO "\n68EZ328 DragonBallEZ support (C) 1999 Rt-Control, Inc\n" ); +pr_info ("68EZ328 DragonBallEZ support (C) 1999 Rt-Control, Inc\n" );#ifdef CONFIG_UCSIMM -printk (KERN_INFO "uCsimm serial string [%s]\n" ,getserialnum ()); +pr_info ("uCsimm serial string [%s]\n" ,getserialnum ()); p = cs8900a_hwaddr =gethwaddr (0 ); -printk (KERN_INFO "uCsimm hwaddr %pM\n" , p); +pr_info ("uCsimm hwaddr %pM\n" , p); p =getbenv ("APPEND" );if (p)strcpy (p,command);
arch/m68k/68000/m68VZ328.c +3 -3
@@ -150,9 +150,9 @@ static void __init init_hardware(char *command, int size) {char *p; -printk (KERN_INFO "uCdimm serial string [%s]\n" ,getserialnum ()); +pr_info ("uCdimm serial string [%s]\n" ,getserialnum ()); p = cs8900a_hwaddr =gethwaddr (0 ); -printk (KERN_INFO "uCdimm hwaddr %pM\n" , p); +pr_info ("uCdimm hwaddr %pM\n" , p); p =getbenv ("APPEND" );if (p)strcpy (p, command);
@@ -177,7 +177,7 @@ static void __init init_hardware(char *command, int size)void __init config_BSP (char *command,int size) { -printk (KERN_INFO "68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n" ); +pr_info ("68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n" );init_hardware (command, size);
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 4/22 m68k/68000: Modernize printing of kernel messages
In reply to Geert UytterhoevenConvert from printk() to pr_*().
--- arch/m68k/68000/m68328.c | 6 +++--- arch/m68k/68000/m68EZ328.c | 6 +++--- arch/m68k/68000/m68VZ328.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-)
arch/m68k/68000/m68328.c +3 -3
@@ -45,9 +45,9 @@ void m68328_reset (void)void __init config_BSP (char *command,int len) { -printk (KERN_INFO "\n68328 support D. Jeff Dionne <[email protected]>\n" ); -printk (KERN_INFO "68328 support Kenneth Albanowski <[email protected]>\n" ); -printk (KERN_INFO "68328/Pilot support Bernhard Kuhn <[email protected]>\n" ); +pr_info ("68328 support D. Jeff Dionne <[email protected]>\n" ); +pr_info ("68328 support Kenneth Albanowski <[email protected]>\n" ); +pr_info ("68328/Pilot support Bernhard Kuhn <[email protected]>\n" ); mach_hwclk = m68328_hwclk; mach_reset = m68328_reset;
arch/m68k/68000/m68EZ328.c +3 -3
@@ -57,12 +57,12 @@ void __init config_BSP(char *command, int len) {unsigned char *p; -printk (KERN_INFO "\n68EZ328 DragonBallEZ support (C) 1999 Rt-Control, Inc\n" ); +pr_info ("68EZ328 DragonBallEZ support (C) 1999 Rt-Control, Inc\n" );#ifdef CONFIG_UCSIMM -printk (KERN_INFO "uCsimm serial string [%s]\n" ,getserialnum ()); +pr_info ("uCsimm serial string [%s]\n" ,getserialnum ()); p = cs8900a_hwaddr =gethwaddr (0 ); -printk (KERN_INFO "uCsimm hwaddr %pM\n" , p); +pr_info ("uCsimm hwaddr %pM\n" , p); p =getbenv ("APPEND" );if (p)strcpy (p,command);
arch/m68k/68000/m68VZ328.c +3 -3
@@ -150,9 +150,9 @@ static void __init init_hardware(char *command, int size) {char *p; -printk (KERN_INFO "uCdimm serial string [%s]\n" ,getserialnum ()); +pr_info ("uCdimm serial string [%s]\n" ,getserialnum ()); p = cs8900a_hwaddr =gethwaddr (0 ); -printk (KERN_INFO "uCdimm hwaddr %pM\n" , p); +pr_info ("uCdimm hwaddr %pM\n" , p); p =getbenv ("APPEND" );if (p)strcpy (p, command);
@@ -177,7 +177,7 @@ static void __init init_hardware(char *command, int size)void __init config_BSP (char *command,int size) { -printk (KERN_INFO "68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n" ); +pr_info ("68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n" );init_hardware (command, size);
Signature · 1 line
1.9.1
Re: [PATCH 04/22] m68k/68000: Modernize printing of kernel messages
Hi Geert,
Quoted 3 lines · Geert Uytterhoeven
Convert from
printk()to pr_*().Signed-off-by Geert Uytterhoeven <[email protected]>
Looks good to me, so:
Regards
Greg
Quoted 69 lines
--- arch/m68k/68000/m68328.c | 6 +++--- arch/m68k/68000/m68EZ328.c | 6 +++--- arch/m68k/68000/m68VZ328.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-)arch/m68k/68000/m68328.c +3
-3@@ -45,9 +45,9 @@ void m68328_reset (void)void __init config_BSP (char *command,int len) { -printk (KERN_INFO "\n68328 support D. Jeff Dionne <[email protected]>\n" ); -printk (KERN_INFO "68328 support Kenneth Albanowski <[email protected]>\n" ); -printk (KERN_INFO "68328/Pilot support Bernhard Kuhn <[email protected]>\n" ); +pr_info ("68328 support D. Jeff Dionne <[email protected]>\n" ); +pr_info ("68328 support Kenneth Albanowski <[email protected]>\n" ); +pr_info ("68328/Pilot support Bernhard Kuhn <[email protected]>\n" ); mach_hwclk = m68328_hwclk; mach_reset = m68328_reset;arch/m68k/68000/m68EZ328.c +3
-3@@ -57,12 +57,12 @@ void __init config_BSP(char *command, int len) {unsigned char *p; -printk (KERN_INFO "\n68EZ328 DragonBallEZ support (C) 1999 Rt-Control, Inc\n" ); +pr_info ("68EZ328 DragonBallEZ support (C) 1999 Rt-Control, Inc\n" );#ifdef CONFIG_UCSIMM -printk (KERN_INFO "uCsimm serial string [%s]\n" ,getserialnum ()); +pr_info ("uCsimm serial string [%s]\n" ,getserialnum ()); p = cs8900a_hwaddr =gethwaddr (0 ); -printk (KERN_INFO "uCsimm hwaddr %pM\n" , p); +pr_info ("uCsimm hwaddr %pM\n" , p); p =getbenv ("APPEND" );if (p)strcpy (p,command);arch/m68k/68000/m68VZ328.c +3
-3@@ -150,9 +150,9 @@ static void __init init_hardware(char *command, int size) {char *p; -printk (KERN_INFO "uCdimm serial string [%s]\n" ,getserialnum ()); +pr_info ("uCdimm serial string [%s]\n" ,getserialnum ()); p = cs8900a_hwaddr =gethwaddr (0 ); -printk (KERN_INFO "uCdimm hwaddr %pM\n" , p); +pr_info ("uCdimm hwaddr %pM\n" , p); p =getbenv ("APPEND" );if (p)strcpy (p, command);@@ -177,7 +177,7 @@ static void __init init_hardware(char *command, int size)void __init config_BSP (char *command,int size) { -printk (KERN_INFO "68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n" ); +pr_info ("68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n" );init_hardware (command, size);
Re: [PATCH 04/22] m68k/68000: Modernize printing of kernel messages
In reply to Geert UytterhoevenHi Geert,
Quoted 3 lines · Geert Uytterhoeven
Convert from
printk()to pr_*().Signed-off-by Geert Uytterhoeven <[email protected]>
Looks good to me, so:
Regards
Greg
Quoted 69 lines
--- arch/m68k/68000/m68328.c | 6 +++--- arch/m68k/68000/m68EZ328.c | 6 +++--- arch/m68k/68000/m68VZ328.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-)arch/m68k/68000/m68328.c +3
-3@@ -45,9 +45,9 @@ void m68328_reset (void)void __init config_BSP (char *command,int len) { -printk (KERN_INFO "\n68328 support D. Jeff Dionne <[email protected]>\n" ); -printk (KERN_INFO "68328 support Kenneth Albanowski <[email protected]>\n" ); -printk (KERN_INFO "68328/Pilot support Bernhard Kuhn <[email protected]>\n" ); +pr_info ("68328 support D. Jeff Dionne <[email protected]>\n" ); +pr_info ("68328 support Kenneth Albanowski <[email protected]>\n" ); +pr_info ("68328/Pilot support Bernhard Kuhn <[email protected]>\n" ); mach_hwclk = m68328_hwclk; mach_reset = m68328_reset;arch/m68k/68000/m68EZ328.c +3
-3@@ -57,12 +57,12 @@ void __init config_BSP(char *command, int len) {unsigned char *p; -printk (KERN_INFO "\n68EZ328 DragonBallEZ support (C) 1999 Rt-Control, Inc\n" ); +pr_info ("68EZ328 DragonBallEZ support (C) 1999 Rt-Control, Inc\n" );#ifdef CONFIG_UCSIMM -printk (KERN_INFO "uCsimm serial string [%s]\n" ,getserialnum ()); +pr_info ("uCsimm serial string [%s]\n" ,getserialnum ()); p = cs8900a_hwaddr =gethwaddr (0 ); -printk (KERN_INFO "uCsimm hwaddr %pM\n" , p); +pr_info ("uCsimm hwaddr %pM\n" , p); p =getbenv ("APPEND" );if (p)strcpy (p,command);arch/m68k/68000/m68VZ328.c +3
-3@@ -150,9 +150,9 @@ static void __init init_hardware(char *command, int size) {char *p; -printk (KERN_INFO "uCdimm serial string [%s]\n" ,getserialnum ()); +pr_info ("uCdimm serial string [%s]\n" ,getserialnum ()); p = cs8900a_hwaddr =gethwaddr (0 ); -printk (KERN_INFO "uCdimm hwaddr %pM\n" , p); +pr_info ("uCdimm hwaddr %pM\n" , p); p =getbenv ("APPEND" );if (p)strcpy (p, command);@@ -177,7 +177,7 @@ static void __init init_hardware(char *command, int size)void __init config_BSP (char *command,int size) { -printk (KERN_INFO "68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n" ); +pr_info ("68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n" );init_hardware (command, size);
Geert Uytterhoeven
maintainerPATCH 5/22 m68k/bvme6000: Modernize printing of kernel messages
In reply to Geert UytterhoevenConvert from printk() to pr_*().
--- arch/m68k/bvme6000/config.c | 8 ++++---- arch/m68k/bvme6000/rtc.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
arch/m68k/bvme6000/config.c +4 -4
@@ -63,8 +63,8 @@ void bvme6000_reset(void) {volatile PitRegsPtr pit = (PitRegsPtr )BVME_PIT_BASE ; -printk ("\r\n\nCalled bvme6000_reset\r\n" -"\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r" ); +pr_info ("\r\n\nCalled bvme6000_reset\r\n" +"\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r" );/* The string of returns is to delay the reset until the whole * message is output. */ /* Enable the watchdog, via PIT port C bit 4 */
@@ -117,8 +117,8 @@ void __init config_bvme6000(void) mach_reset = bvme6000_reset; mach_get_model = bvme6000_get_model; -printk ("Board is %sconfigured as a System Controller\n" , - *config_reg_ptr &BVME_CONFIG_SW1 ?"" :"not " ); +pr_info ("Board is %sconfigured as a System Controller\n" , + *config_reg_ptr &BVME_CONFIG_SW1 ?"" :"not " );/* Now do the PIT configuration */
arch/m68k/bvme6000/rtc.c +1 -1
@@ -168,7 +168,7 @@ static int __init rtc_DP8570A_init(void)if (!MACH_IS_BVME6000 )return -ENODEV ; -printk (KERN_INFO "DP8570A Real Time Clock Driver v%s\n" ,RTC_VERSION ); +pr_info ("DP8570A Real Time Clock Driver v%s\n" ,RTC_VERSION );return misc_register (&rtc_dev); }module_init (rtc_DP8570A_init);
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 6/22 m68k/coldfire: Modernize printing of kernel messages
In reply to Geert Uytterhoeven - Introduce helpers for printing debug messages, incl. dummies for validating format strings when debugging is disabled,
- Convert from printk() to pr_*(),
- Correct printf()-style format specifiers,
- Drop superfluous casts,
--- arch/m68k/coldfire/m528x.c | 4 +- arch/m68k/coldfire/sltimers.c | 4 +- arch/m68k/coldfire/timers.c | 4 +- arch/m68k/coldfire/vectors.c | 2 +- arch/m68k/include/asm/dma.h | 98 +++++++++++++------------------------ arch/m68k/include/asm/mcf_pgtable.h | 9 ++-- 6 files changed, 44 insertions(+), 77 deletions(-)
arch/m68k/coldfire/m528x.c +2 -2
@@ -99,7 +99,7 @@ void wildfire_halt(void)#ifdef CONFIG_WILDFIREMOD void wildfiremod_halt (void ) { -printk (KERN_INFO "WildFireMod hibernating...\n" ); +pr_info ("WildFireMod hibernating...\n" );/* Set portE.5 to Digital IO */ writew (readw (MCFGPIO_PEPAR ) & ~(1 << (5 *2 )),MCFGPIO_PEPAR );
@@ -111,7 +111,7 @@ void wildfiremod_halt(void)writeb (readb (MCFGPIO_PODR_E ) & ~(1 <<5 ),MCFGPIO_PODR_E );writeb (readb (MCFGPIO_PODR_E ) | (1 <<5 ),MCFGPIO_PODR_E ); - printk(KERN_EMERG "Failed to hibernate. Halting!\n"); + pr_emerg("Failed to hibernate. Halting!\n"); }#endif
arch/m68k/coldfire/sltimers.c +2 -2
@@ -57,8 +57,8 @@ irqreturn_t mcfslt_profile_tick(int irq, void *dummy)void mcfslt_profile_init (void ) { -printk (KERN_INFO "PROFILE: lodging TIMER 1 @ %dHz as profile timer\n" , -PROFILEHZ ); +pr_info ("PROFILE: lodging TIMER 1 @ %dHz as profile timer\n" , +PROFILEHZ );setup_irq (MCF_IRQ_PROFILER , &mcfslt_profile_irq);
arch/m68k/coldfire/timers.c +2 -2
@@ -177,8 +177,8 @@ irqreturn_t coldfire_profile_tick(int irq, void *dummy)void coldfire_profile_init (void ) { -printk (KERN_INFO "PROFILE: lodging TIMER2 @ %dHz as profile timer\n" , -PROFILEHZ ); +pr_info ("PROFILE: lodging TIMER2 @ %dHz as profile timer\n" , +PROFILEHZ );/* Set up TIMER 2 as high speed profile clock */ __raw_writew (MCFTIMER_TMR_DISABLE ,PA (MCFTIMER_TMR ));
arch/m68k/coldfire/vectors.c +1 -1
@@ -24,7 +24,7 @@ asmlinkage void dbginterrupt_c(struct frame *fp) {extern void dump (struct pt_regs *fp); -printk (KERN_DEBUG "%s(%d): BUS ERROR TRAP\n" , __FILE__, __LINE__); +pr_debug ("%s(%d): BUS ERROR TRAP\n" , __FILE__, __LINE__);dump ((struct pt_regs *) fp); asm("halt" ); }
arch/m68k/include/asm/dma.h +34 -64
212 lines not on this page · raw message
arch/m68k/include/asm/mcf_pgtable.h +3 -6
@@ -203,14 +203,11 @@ static inline void pte_clear(struct mm_struct *mm, unsigned long addr,static inline void pgd_clear (pgd_t *pgdp) {}#define pte_ERROR (e) \ - printk(KERN_ERR "%s:%d: bad pte %08lx.\n", \ - __FILE__, __LINE__, pte_val(e)) + pr_err("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))#define pmd_ERROR (e) \ - printk(KERN_ERR "%s:%d: bad pmd %08lx.\n", \ - __FILE__, __LINE__, pmd_val(e)) + pr_err("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e))#define pgd_ERROR (e) \ - printk(KERN_ERR "%s:%d: bad pgd %08lx.\n", \ - __FILE__, __LINE__, pgd_val(e)) + pr_err("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))/* * The following only work if pte_present() is true.
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 6/22 m68k/coldfire: Modernize printing of kernel messages
In reply to Geert Uytterhoeven - Introduce helpers for printing debug messages, incl. dummies for validating format strings when debugging is disabled,
- Convert from printk() to pr_*(),
- Correct printf()-style format specifiers,
- Drop superfluous casts,
--- arch/m68k/coldfire/m528x.c | 4 +- arch/m68k/coldfire/sltimers.c | 4 +- arch/m68k/coldfire/timers.c | 4 +- arch/m68k/coldfire/vectors.c | 2 +- arch/m68k/include/asm/dma.h | 98 +++++++++++++------------------------ arch/m68k/include/asm/mcf_pgtable.h | 9 ++-- 6 files changed, 44 insertions(+), 77 deletions(-)
arch/m68k/coldfire/m528x.c +2 -2
@@ -99,7 +99,7 @@ void wildfire_halt(void)#ifdef CONFIG_WILDFIREMOD void wildfiremod_halt (void ) { -printk (KERN_INFO "WildFireMod hibernating...\n" ); +pr_info ("WildFireMod hibernating...\n" );/* Set portE.5 to Digital IO */ writew (readw (MCFGPIO_PEPAR ) & ~(1 << (5 *2 )),MCFGPIO_PEPAR );
@@ -111,7 +111,7 @@ void wildfiremod_halt(void)writeb (readb (MCFGPIO_PODR_E ) & ~(1 <<5 ),MCFGPIO_PODR_E );writeb (readb (MCFGPIO_PODR_E ) | (1 <<5 ),MCFGPIO_PODR_E ); - printk(KERN_EMERG "Failed to hibernate. Halting!\n"); + pr_emerg("Failed to hibernate. Halting!\n"); }#endif
arch/m68k/coldfire/sltimers.c +2 -2
@@ -57,8 +57,8 @@ irqreturn_t mcfslt_profile_tick(int irq, void *dummy)void mcfslt_profile_init (void ) { -printk (KERN_INFO "PROFILE: lodging TIMER 1 @ %dHz as profile timer\n" , -PROFILEHZ ); +pr_info ("PROFILE: lodging TIMER 1 @ %dHz as profile timer\n" , +PROFILEHZ );setup_irq (MCF_IRQ_PROFILER , &mcfslt_profile_irq);
arch/m68k/coldfire/timers.c +2 -2
@@ -177,8 +177,8 @@ irqreturn_t coldfire_profile_tick(int irq, void *dummy)void coldfire_profile_init (void ) { -printk (KERN_INFO "PROFILE: lodging TIMER2 @ %dHz as profile timer\n" , -PROFILEHZ ); +pr_info ("PROFILE: lodging TIMER2 @ %dHz as profile timer\n" , +PROFILEHZ );/* Set up TIMER 2 as high speed profile clock */ __raw_writew (MCFTIMER_TMR_DISABLE ,PA (MCFTIMER_TMR ));
arch/m68k/coldfire/vectors.c +1 -1
@@ -24,7 +24,7 @@ asmlinkage void dbginterrupt_c(struct frame *fp) {extern void dump (struct pt_regs *fp); -printk (KERN_DEBUG "%s(%d): BUS ERROR TRAP\n" , __FILE__, __LINE__); +pr_debug ("%s(%d): BUS ERROR TRAP\n" , __FILE__, __LINE__);dump ((struct pt_regs *) fp); asm("halt" ); }
arch/m68k/include/asm/dma.h +34 -64
212 lines not on this page · raw message
arch/m68k/include/asm/mcf_pgtable.h +3 -6
@@ -203,14 +203,11 @@ static inline void pte_clear(struct mm_struct *mm, unsigned long addr,static inline void pgd_clear (pgd_t *pgdp) {}#define pte_ERROR (e) \ - printk(KERN_ERR "%s:%d: bad pte %08lx.\n", \ - __FILE__, __LINE__, pte_val(e)) + pr_err("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))#define pmd_ERROR (e) \ - printk(KERN_ERR "%s:%d: bad pmd %08lx.\n", \ - __FILE__, __LINE__, pmd_val(e)) + pr_err("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e))#define pgd_ERROR (e) \ - printk(KERN_ERR "%s:%d: bad pgd %08lx.\n", \ - __FILE__, __LINE__, pgd_val(e)) + pr_err("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))/* * The following only work if pte_present() is true.
Signature · 1 line
1.9.1
Re: [PATCH 06/22] m68k/coldfire: Modernize printing of kernel messages
Quoted 73 lines · Geert Uytterhoeven
- Introduce helpers for printing debug messages, incl. dummies for validating format strings when debugging is disabled,
- Convert fromprintk()to pr_*(),
- Correct printf()-style format specifiers,
- Drop superfluous casts,Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/coldfire/m528x.c | 4 +- arch/m68k/coldfire/sltimers.c | 4 +- arch/m68k/coldfire/timers.c | 4 +- arch/m68k/coldfire/vectors.c | 2 +- arch/m68k/include/asm/dma.h | 98 +++++++++++++------------------------ arch/m68k/include/asm/mcf_pgtable.h | 9 ++-- 6 files changed, 44 insertions(+), 77 deletions(-)arch/m68k/coldfire/m528x.c +2
-2@@ -99,7 +99,7 @@ void wildfire_halt(void)#ifdef CONFIG_WILDFIREMOD void wildfiremod_halt (void ) { -printk (KERN_INFO "WildFireMod hibernating...\n" ); +pr_info ("WildFireMod hibernating...\n" );/* Set portE.5 to Digital IO */ writew (readw (MCFGPIO_PEPAR ) & ~(1 << (5 *2 )),MCFGPIO_PEPAR );@@ -111,7 +111,7 @@ void wildfiremod_halt(void)writeb (readb (MCFGPIO_PODR_E ) & ~(1 <<5 ),MCFGPIO_PODR_E );writeb (readb (MCFGPIO_PODR_E ) | (1 <<5 ),MCFGPIO_PODR_E ); - printk(KERN_EMERG "Failed to hibernate. Halting!\n"); + pr_emerg("Failed to hibernate. Halting!\n"); }#endif arch/m68k/coldfire/sltimers.c +2
-2@@ -57,8 +57,8 @@ irqreturn_t mcfslt_profile_tick(int irq, void *dummy)void mcfslt_profile_init (void ) { -printk (KERN_INFO "PROFILE: lodging TIMER 1 @ %dHz as profile timer\n" , -PROFILEHZ ); +pr_info ("PROFILE: lodging TIMER 1 @ %dHz as profile timer\n" , +PROFILEHZ );setup_irq (MCF_IRQ_PROFILER , &mcfslt_profile_irq);arch/m68k/coldfire/timers.c +2
-2@@ -177,8 +177,8 @@ irqreturn_t coldfire_profile_tick(int irq, void *dummy)void coldfire_profile_init (void ) { -printk (KERN_INFO "PROFILE: lodging TIMER2 @ %dHz as profile timer\n" , -PROFILEHZ ); +pr_info ("PROFILE: lodging TIMER2 @ %dHz as profile timer\n" , +PROFILEHZ );/* Set up TIMER 2 as high speed profile clock */ __raw_writew (MCFTIMER_TMR_DISABLE ,PA (MCFTIMER_TMR ));arch/m68k/coldfire/vectors.c +0
-0
arch/m68k/coldfire/vectors.c line 30
Quoted 8 lines
arch/m68k/coldfire/vectors.c +1
-1@@ -24,7 +24,7 @@ asmlinkage void dbginterrupt_c(struct frame *fp) {extern void dump (struct pt_regs *fp); -printk (KERN_DEBUG "%s(%d): BUS ERROR TRAP\n" , __FILE__, __LINE__); +pr_debug ("%s(%d): BUS ERROR TRAP\n" , __FILE__, __LINE__);dump ((struct pt_regs *) fp); asm("halt" ); }
This file also seems to lack #define DEBUG, so you and Greg might want to check this change.
Greg Ungerer
maintainerRe: [PATCH 06/22] m68k/coldfire: Modernize printing of kernel messages
Hi Finn, Geert,
Quoted 19 lines · Finn Thain
Quoted 16 lines · Geert Uytterhoeven
- Introduce helpers for printing debug messages, incl. dummies for validating format strings when debugging is disabled,
- Convert fromprintk()to pr_*(),
- Correct printf()-style format specifiers,
- Drop superfluous casts,Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/coldfire/m528x.c | 4 +- arch/m68k/coldfire/sltimers.c | 4 +- arch/m68k/coldfire/timers.c | 4 +- arch/m68k/coldfire/vectors.c | 2 +- arch/m68k/include/asm/dma.h | 98 +++++++++++++------------------------ arch/m68k/include/asm/mcf_pgtable.h | 9 ++-- 6 files changed, 44 insertions(+), 77 deletions(-)
[snip]
Quoted 8 lines
Quoted 8 lines
arch/m68k/coldfire/vectors.c +0
-0@@ -24,7 +24,7 @@ asmlinkage void dbginterrupt_c(struct frame *fp) {extern void dump (struct pt_regs *fp);
Quoted 8 lines
arch/m68k/coldfire/vectors.c line 30
Quoted 5 lines
arch/m68k/coldfire/vectors.c +1
-1-printk (KERN_DEBUG "%s(%d): BUS ERROR TRAP\n" , __FILE__, __LINE__); +pr_debug ("%s(%d): BUS ERROR TRAP\n" , __FILE__, __LINE__);dump ((struct pt_regs *) fp); asm("halt" ); }This file also seems to lack #define DEBUG, so you and Greg might want to check this change.
I think we still want this message in, even if DEBUG is not defined. This code is conditionally compiled in for hardware debuger processing - and this message should really come out if this trap case occurs so the user has some idea that it just tripped. (The text of the message is not perfect, but that is a separate issue).
Perhaps pr_alert() or pr_crit() would be better?
Regards
Greg
Re: [PATCH 06/22] m68k/coldfire: Modernize printing of kernel messages
In reply to Geert UytterhoevenQuoted 73 lines · Geert Uytterhoeven
- Introduce helpers for printing debug messages, incl. dummies for validating format strings when debugging is disabled,
- Convert fromprintk()to pr_*(),
- Correct printf()-style format specifiers,
- Drop superfluous casts,Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/coldfire/m528x.c | 4 +- arch/m68k/coldfire/sltimers.c | 4 +- arch/m68k/coldfire/timers.c | 4 +- arch/m68k/coldfire/vectors.c | 2 +- arch/m68k/include/asm/dma.h | 98 +++++++++++++------------------------ arch/m68k/include/asm/mcf_pgtable.h | 9 ++-- 6 files changed, 44 insertions(+), 77 deletions(-)arch/m68k/coldfire/m528x.c +2
-2@@ -99,7 +99,7 @@ void wildfire_halt(void)#ifdef CONFIG_WILDFIREMOD void wildfiremod_halt (void ) { -printk (KERN_INFO "WildFireMod hibernating...\n" ); +pr_info ("WildFireMod hibernating...\n" );/* Set portE.5 to Digital IO */ writew (readw (MCFGPIO_PEPAR ) & ~(1 << (5 *2 )),MCFGPIO_PEPAR );@@ -111,7 +111,7 @@ void wildfiremod_halt(void)writeb (readb (MCFGPIO_PODR_E ) & ~(1 <<5 ),MCFGPIO_PODR_E );writeb (readb (MCFGPIO_PODR_E ) | (1 <<5 ),MCFGPIO_PODR_E ); - printk(KERN_EMERG "Failed to hibernate. Halting!\n"); + pr_emerg("Failed to hibernate. Halting!\n"); }#endif arch/m68k/coldfire/sltimers.c +2
-2@@ -57,8 +57,8 @@ irqreturn_t mcfslt_profile_tick(int irq, void *dummy)void mcfslt_profile_init (void ) { -printk (KERN_INFO "PROFILE: lodging TIMER 1 @ %dHz as profile timer\n" , -PROFILEHZ ); +pr_info ("PROFILE: lodging TIMER 1 @ %dHz as profile timer\n" , +PROFILEHZ );setup_irq (MCF_IRQ_PROFILER , &mcfslt_profile_irq);arch/m68k/coldfire/timers.c +2
-2@@ -177,8 +177,8 @@ irqreturn_t coldfire_profile_tick(int irq, void *dummy)void coldfire_profile_init (void ) { -printk (KERN_INFO "PROFILE: lodging TIMER2 @ %dHz as profile timer\n" , -PROFILEHZ ); +pr_info ("PROFILE: lodging TIMER2 @ %dHz as profile timer\n" , +PROFILEHZ );/* Set up TIMER 2 as high speed profile clock */ __raw_writew (MCFTIMER_TMR_DISABLE ,PA (MCFTIMER_TMR ));arch/m68k/coldfire/vectors.c +0
-0
arch/m68k/coldfire/vectors.c line 30
Quoted 8 lines
arch/m68k/coldfire/vectors.c +1
-1@@ -24,7 +24,7 @@ asmlinkage void dbginterrupt_c(struct frame *fp) {extern void dump (struct pt_regs *fp); -printk (KERN_DEBUG "%s(%d): BUS ERROR TRAP\n" , __FILE__, __LINE__); +pr_debug ("%s(%d): BUS ERROR TRAP\n" , __FILE__, __LINE__);dump ((struct pt_regs *) fp); asm("halt" ); }
This file also seems to lack #define DEBUG, so you and Greg might want to check this change.
Geert Uytterhoeven
maintainerPATCH 7/22 m68k/mac: baboon - Modernize printing of kernel messages
In reply to Geert Uytterhoeven - Introduce helpers for printing debug messages, incl. dummies for validating format strings when debugging is disabled,
- Convert from printk() to pr_*(),
- Drop superfluous casts.
--- arch/m68k/mac/baboon.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-)
arch/m68k/mac/baboon.c +10 -12
@@ -15,6 +15,11 @@#include <asm/mac_baboon.h> /* #define DEBUG_IRQS */ +#ifdef DEBUG_IRQS +#define pr_irq (fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#else +#define pr_irq (fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#endif int baboon_present;static volatile struct baboon *baboon;
@@ -38,7 +43,7 @@ void __init baboon_init(void) baboon = (struct baboon *)BABOON_BASE ; baboon_present =1 ; -printk ("Baboon detected at %p\n" , baboon); +pr_info ("Baboon detected at %p\n" , baboon); }/*
@@ -50,11 +55,8 @@ static void baboon_irq(struct irq_desc *desc)int irq_bit, irq_num;unsigned char events; -#ifdef DEBUG_IRQS -printk ("baboon_irq: mb_control %02X mb_ifr %02X mb_status %02X\n" , - (uint ) baboon->mb_control, (uint ) baboon->mb_ifr, - (uint ) baboon->mb_status); -#endif +pr_irq ("baboon_irq: mb_control %02X mb_ifr %02X mb_status %02X\n" , + baboon->mb_control, baboon->mb_ifr, baboon->mb_status); events = baboon->mb_ifr &0x07 ;if (!events)
@@ -97,18 +99,14 @@ void __init baboon_register_interrupts(void)void baboon_irq_enable (int irq) { -#ifdef DEBUG_IRQUSE -printk ("baboon_irq_enable(%d)\n" , irq); -#endif +pr_irq ("baboon_irq_enable(%d)\n" , irq);mac_irq_enable (irq_get_irq_data (IRQ_NUBUS_C )); }void baboon_irq_disable (int irq) { -#ifdef DEBUG_IRQUSE -printk ("baboon_irq_disable(%d)\n" , irq); -#endif +pr_irq ("baboon_irq_disable(%d)\n" , irq);mac_irq_disable (irq_get_irq_data (IRQ_NUBUS_C )); }
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 7/22 m68k/mac: baboon - Modernize printing of kernel messages
In reply to Geert Uytterhoeven - Introduce helpers for printing debug messages, incl. dummies for validating format strings when debugging is disabled,
- Convert from printk() to pr_*(),
- Drop superfluous casts.
--- arch/m68k/mac/baboon.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-)
arch/m68k/mac/baboon.c +10 -12
@@ -15,6 +15,11 @@#include <asm/mac_baboon.h> /* #define DEBUG_IRQS */ +#ifdef DEBUG_IRQS +#define pr_irq (fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#else +#define pr_irq (fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#endif int baboon_present;static volatile struct baboon *baboon;
@@ -38,7 +43,7 @@ void __init baboon_init(void) baboon = (struct baboon *)BABOON_BASE ; baboon_present =1 ; -printk ("Baboon detected at %p\n" , baboon); +pr_info ("Baboon detected at %p\n" , baboon); }/*
@@ -50,11 +55,8 @@ static void baboon_irq(struct irq_desc *desc)int irq_bit, irq_num;unsigned char events; -#ifdef DEBUG_IRQS -printk ("baboon_irq: mb_control %02X mb_ifr %02X mb_status %02X\n" , - (uint ) baboon->mb_control, (uint ) baboon->mb_ifr, - (uint ) baboon->mb_status); -#endif +pr_irq ("baboon_irq: mb_control %02X mb_ifr %02X mb_status %02X\n" , + baboon->mb_control, baboon->mb_ifr, baboon->mb_status); events = baboon->mb_ifr &0x07 ;if (!events)
@@ -97,18 +99,14 @@ void __init baboon_register_interrupts(void)void baboon_irq_enable (int irq) { -#ifdef DEBUG_IRQUSE -printk ("baboon_irq_enable(%d)\n" , irq); -#endif +pr_irq ("baboon_irq_enable(%d)\n" , irq);mac_irq_enable (irq_get_irq_data (IRQ_NUBUS_C )); }void baboon_irq_disable (int irq) { -#ifdef DEBUG_IRQUSE -printk ("baboon_irq_disable(%d)\n" , irq); -#endif +pr_irq ("baboon_irq_disable(%d)\n" , irq);mac_irq_disable (irq_get_irq_data (IRQ_NUBUS_C )); }
Signature · 1 line
1.9.1
Re: [PATCH 07/22] m68k/mac: baboon - Modernize printing of kernel messages
Quoted 15 lines · Geert Uytterhoeven
- Introduce helpers for printing debug messages, incl. dummies for validating format strings when debugging is disabled,
- Convert fromprintk()to pr_*(),
- Drop superfluous casts.Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/mac/baboon.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-)arch/m68k/mac/baboon.c +0
-0
arch/m68k/mac/baboon.c line 23
Quoted 9 lines
arch/m68k/mac/baboon.c +5
-0@@ -15,6 +15,11 @@#include <asm/mac_baboon.h> /* #define DEBUG_IRQS */ +#ifdef DEBUG_IRQS +#define pr_irq (fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#else +#define pr_irq (fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#endif
I'd prefer to drop the DEBUG_IRQS printk messages in this file.
Thanks.
Quoted 47 lines
arch/m68k/mac/baboon.c +5
-12int baboon_present;static volatile struct baboon *baboon;@@ -38,7 +43,7 @@ void __init baboon_init(void) baboon = (struct baboon *)BABOON_BASE ; baboon_present =1 ; -printk ("Baboon detected at %p\n" , baboon); +pr_info ("Baboon detected at %p\n" , baboon); }/* @@ -50,11 +55,8 @@ static void baboon_irq(struct irq_desc *desc)int irq_bit, irq_num;unsigned char events; -#ifdef DEBUG_IRQS -printk ("baboon_irq: mb_control %02X mb_ifr %02X mb_status %02X\n" , - (uint ) baboon->mb_control, (uint ) baboon->mb_ifr, - (uint ) baboon->mb_status); -#endif +pr_irq ("baboon_irq: mb_control %02X mb_ifr %02X mb_status %02X\n" , + baboon->mb_control, baboon->mb_ifr, baboon->mb_status); events = baboon->mb_ifr &0x07 ;if (!events)@@ -97,18 +99,14 @@ void __init baboon_register_interrupts(void)void baboon_irq_enable (int irq) { -#ifdef DEBUG_IRQUSE -printk ("baboon_irq_enable(%d)\n" , irq); -#endif +pr_irq ("baboon_irq_enable(%d)\n" , irq);mac_irq_enable (irq_get_irq_data (IRQ_NUBUS_C )); }void baboon_irq_disable (int irq) { -#ifdef DEBUG_IRQUSE -printk ("baboon_irq_disable(%d)\n" , irq); -#endif +pr_irq ("baboon_irq_disable(%d)\n" , irq);mac_irq_disable (irq_get_irq_data (IRQ_NUBUS_C )); }
Re: [PATCH 07/22] m68k/mac: baboon - Modernize printing of kernel messages
In reply to Geert UytterhoevenQuoted 15 lines · Geert Uytterhoeven
- Introduce helpers for printing debug messages, incl. dummies for validating format strings when debugging is disabled,
- Convert fromprintk()to pr_*(),
- Drop superfluous casts.Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/mac/baboon.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-)arch/m68k/mac/baboon.c +0
-0
arch/m68k/mac/baboon.c line 23
Quoted 9 lines
arch/m68k/mac/baboon.c +5
-0@@ -15,6 +15,11 @@#include <asm/mac_baboon.h> /* #define DEBUG_IRQS */ +#ifdef DEBUG_IRQS +#define pr_irq (fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#else +#define pr_irq (fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#endif
I'd prefer to drop the DEBUG_IRQS printk messages in this file.
Thanks.
Quoted 47 lines
arch/m68k/mac/baboon.c +5
-12int baboon_present;static volatile struct baboon *baboon;@@ -38,7 +43,7 @@ void __init baboon_init(void) baboon = (struct baboon *)BABOON_BASE ; baboon_present =1 ; -printk ("Baboon detected at %p\n" , baboon); +pr_info ("Baboon detected at %p\n" , baboon); }/* @@ -50,11 +55,8 @@ static void baboon_irq(struct irq_desc *desc)int irq_bit, irq_num;unsigned char events; -#ifdef DEBUG_IRQS -printk ("baboon_irq: mb_control %02X mb_ifr %02X mb_status %02X\n" , - (uint ) baboon->mb_control, (uint ) baboon->mb_ifr, - (uint ) baboon->mb_status); -#endif +pr_irq ("baboon_irq: mb_control %02X mb_ifr %02X mb_status %02X\n" , + baboon->mb_control, baboon->mb_ifr, baboon->mb_status); events = baboon->mb_ifr &0x07 ;if (!events)@@ -97,18 +99,14 @@ void __init baboon_register_interrupts(void)void baboon_irq_enable (int irq) { -#ifdef DEBUG_IRQUSE -printk ("baboon_irq_enable(%d)\n" , irq); -#endif +pr_irq ("baboon_irq_enable(%d)\n" , irq);mac_irq_enable (irq_get_irq_data (IRQ_NUBUS_C )); }void baboon_irq_disable (int irq) { -#ifdef DEBUG_IRQUSE -printk ("baboon_irq_disable(%d)\n" , irq); -#endif +pr_irq ("baboon_irq_disable(%d)\n" , irq);mac_irq_disable (irq_get_irq_data (IRQ_NUBUS_C )); }
Geert Uytterhoeven
maintainerPATCH 8/22 m68k/mac: iop - Modernize printing of kernel messages
In reply to Geert Uytterhoeven - Introduce helpers for printing debug messages, incl. dummies for validating format strings when debugging is disabled,
- Convert from printk() to pr_*(),
- Add missing continuations,
- Drop superfluous casts.
--- arch/m68k/mac/iop.c | 69 ++++++++++++++++++++++------------------------------- 1 file changed, 29 insertions(+), 40 deletions(-)
arch/m68k/mac/iop.c +29 -40
@@ -116,6 +116,13 @@#include <asm/mac_iop.h> /*#define DEBUG_IOP*/ +#ifdef DEBUG_IOP +#define pr_iop (fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#define pr_iop_cont (fmt, ...) pr_cont(fmt, ##__VA_ARGS__) +#else +#define pr_iop (fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#define pr_iop_cont (fmt, ...) no_printk(fmt, ##__VA_ARGS__) +#endif /* Non-zero if the IOPs are present */
@@ -268,10 +275,10 @@ void __init iop_init(void)int i;if (iop_scc_present) { -printk ("IOP: detected SCC IOP at %p\n" , iop_base[IOP_NUM_SCC ]); +pr_info ("IOP: detected SCC IOP at %p\n" , iop_base[IOP_NUM_SCC ]); }if (iop_ism_present) { -printk ("IOP: detected ISM IOP at %p\n" , iop_base[IOP_NUM_ISM ]); +pr_info ("IOP: detected ISM IOP at %p\n" , iop_base[IOP_NUM_ISM ]);iop_start (iop_base[IOP_NUM_ISM ]);iop_alive (iop_base[IOP_NUM_ISM ]);/* clears the alive flag */ }
@@ -310,9 +317,9 @@ void __init iop_register_interrupts(void)pr_err ("Couldn't register ISM IOP interrupt\n" ); }if (!iop_alive (iop_base[IOP_NUM_ISM ])) { -printk ("IOP: oh my god, they killed the ISM IOP!\n" ); +pr_warn ("IOP: oh my god, they killed the ISM IOP!\n" ); }else { -printk ("IOP: the ISM IOP seems to be alive.\n" ); +pr_info ("IOP: the ISM IOP seems to be alive.\n" ); } } }
@@ -349,9 +356,8 @@ void iop_complete_message(struct iop_msg *msg)int chan = msg->channel;int i,offset; -#ifdef DEBUG_IOP -printk ("iop_complete(%p): iop %d chan %d\n" , msg, msg->iop_num, msg->channel); -#endif +pr_iop ("iop_complete(%p): iop %d chan %d\n" , msg, msg->iop_num, + msg->channel); offset =IOP_ADDR_RECV_MSG + (msg->channel *IOP_MSG_LEN );
@@ -397,9 +403,7 @@ static void iop_handle_send(uint iop_num, uint chan)struct iop_msg *msg,*msg2;int i,offset; -#ifdef DEBUG_IOP -printk ("iop_handle_send: iop %d channel %d\n" , iop_num, chan); -#endif +pr_iop ("iop_handle_send: iop %d channel %d\n" , iop_num, chan);iop_writeb (iop,IOP_ADDR_SEND_STATE + chan,IOP_MSG_IDLE );
@@ -430,9 +434,7 @@ static void iop_handle_recv(uint iop_num, uint chan)int i,offset;struct iop_msg *msg; -#ifdef DEBUG_IOP -printk ("iop_handle_recv: iop %d channel %d\n" , iop_num, chan); -#endif +pr_iop ("iop_handle_recv: iop %d channel %d\n" , iop_num, chan); msg =iop_alloc_msg (); msg->iop_num = iop_num;
@@ -454,13 +456,14 @@ static void iop_handle_recv(uint iop_num, uint chan)if (msg->handler) { (*msg->handler)(msg); }else { +pr_iop ("iop_handle_recv: unclaimed message on iop %d channel %d\n" , + iop_num, chan);#ifdef DEBUG_IOP -printk ("iop_handle_recv: unclaimed message on iop %d channel %d\n" , iop_num, chan); -printk ("iop_handle_recv:" ); +pr_iop ("iop_handle_recv:" );for (i =0 ; i <IOP_MSG_LEN ; i++) { -printk (" %02X" , (uint ) msg->message[i]); +pr_cont (" %02X" , msg->message[i]); } -printk ("\n" ); +pr_iop_cont ("\n" );#endif iop_complete_message (msg); }
@@ -574,50 +577,36 @@ irqreturn_t iop_ism_irq(int irq, void *dev_id)volatile struct mac_iop *iop = iop_base[iop_num];int i,state; -#ifdef DEBUG_IOP -printk ("iop_ism_irq: status = %02X\n" , (uint ) iop->status_ctrl); -#endif +pr_iop ("iop_ism_irq: status = %02X\n" , iop->status_ctrl);/* INT0 indicates a state change on an outgoing message channel */ if (iop->status_ctrl &IOP_INT0 ) { iop->status_ctrl =IOP_INT0 |IOP_RUN |IOP_AUTOINC ; -#ifdef DEBUG_IOP -printk ("iop_ism_irq: new status = %02X, send states" , - (uint ) iop->status_ctrl); -#endif +pr_iop ("iop_ism_irq: new status = %02X, send states" , + iop->status_ctrl);for (i =0 ; i <NUM_IOP_CHAN ; i++) { state =iop_readb (iop,IOP_ADDR_SEND_STATE + i); -#ifdef DEBUG_IOP -printk (" %02X" , state); -#endif +pr_iop_cont (" %02X" , state);if (state ==IOP_MSG_COMPLETE ) {iop_handle_send (iop_num, i); } } -#ifdef DEBUG_IOP -printk ("\n" ); -#endif +pr_iop_cont ("\n" ); }if (iop->status_ctrl &IOP_INT1 ) {/* INT1 for incoming msgs */ iop->status_ctrl =IOP_INT1 |IOP_RUN |IOP_AUTOINC ; -#ifdef DEBUG_IOP -printk ("iop_ism_irq: new status = %02X, recv states" , - (uint ) iop->status_ctrl); -#endif +pr_iop ("iop_ism_irq: new status = %02X, recv states" , + iop->status_ctrl);for (i =0 ; i <NUM_IOP_CHAN ; i++) { state =iop_readb (iop,IOP_ADDR_RECV_STATE + i); -#ifdef DEBUG_IOP -printk (" %02X" , state); -#endif +pr_iop_cont (" %02X" , state);if (state ==IOP_MSG_NEW ) {iop_handle_recv (iop_num, i); } } -#ifdef DEBUG_IOP -printk ("\n" ); -#endif +pr_iop_cont ("\n" ); }return IRQ_HANDLED ; }
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 8/22 m68k/mac: iop - Modernize printing of kernel messages
In reply to Geert Uytterhoeven - Introduce helpers for printing debug messages, incl. dummies for validating format strings when debugging is disabled,
- Convert from printk() to pr_*(),
- Add missing continuations,
- Drop superfluous casts.
--- arch/m68k/mac/iop.c | 69 ++++++++++++++++++++++------------------------------- 1 file changed, 29 insertions(+), 40 deletions(-)
arch/m68k/mac/iop.c +29 -40
@@ -116,6 +116,13 @@#include <asm/mac_iop.h> /*#define DEBUG_IOP*/ +#ifdef DEBUG_IOP +#define pr_iop (fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#define pr_iop_cont (fmt, ...) pr_cont(fmt, ##__VA_ARGS__) +#else +#define pr_iop (fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#define pr_iop_cont (fmt, ...) no_printk(fmt, ##__VA_ARGS__) +#endif /* Non-zero if the IOPs are present */
@@ -268,10 +275,10 @@ void __init iop_init(void)int i;if (iop_scc_present) { -printk ("IOP: detected SCC IOP at %p\n" , iop_base[IOP_NUM_SCC ]); +pr_info ("IOP: detected SCC IOP at %p\n" , iop_base[IOP_NUM_SCC ]); }if (iop_ism_present) { -printk ("IOP: detected ISM IOP at %p\n" , iop_base[IOP_NUM_ISM ]); +pr_info ("IOP: detected ISM IOP at %p\n" , iop_base[IOP_NUM_ISM ]);iop_start (iop_base[IOP_NUM_ISM ]);iop_alive (iop_base[IOP_NUM_ISM ]);/* clears the alive flag */ }
@@ -310,9 +317,9 @@ void __init iop_register_interrupts(void)pr_err ("Couldn't register ISM IOP interrupt\n" ); }if (!iop_alive (iop_base[IOP_NUM_ISM ])) { -printk ("IOP: oh my god, they killed the ISM IOP!\n" ); +pr_warn ("IOP: oh my god, they killed the ISM IOP!\n" ); }else { -printk ("IOP: the ISM IOP seems to be alive.\n" ); +pr_info ("IOP: the ISM IOP seems to be alive.\n" ); } } }
@@ -349,9 +356,8 @@ void iop_complete_message(struct iop_msg *msg)int chan = msg->channel;int i,offset; -#ifdef DEBUG_IOP -printk ("iop_complete(%p): iop %d chan %d\n" , msg, msg->iop_num, msg->channel); -#endif +pr_iop ("iop_complete(%p): iop %d chan %d\n" , msg, msg->iop_num, + msg->channel); offset =IOP_ADDR_RECV_MSG + (msg->channel *IOP_MSG_LEN );
@@ -397,9 +403,7 @@ static void iop_handle_send(uint iop_num, uint chan)struct iop_msg *msg,*msg2;int i,offset; -#ifdef DEBUG_IOP -printk ("iop_handle_send: iop %d channel %d\n" , iop_num, chan); -#endif +pr_iop ("iop_handle_send: iop %d channel %d\n" , iop_num, chan);iop_writeb (iop,IOP_ADDR_SEND_STATE + chan,IOP_MSG_IDLE );
@@ -430,9 +434,7 @@ static void iop_handle_recv(uint iop_num, uint chan)int i,offset;struct iop_msg *msg; -#ifdef DEBUG_IOP -printk ("iop_handle_recv: iop %d channel %d\n" , iop_num, chan); -#endif +pr_iop ("iop_handle_recv: iop %d channel %d\n" , iop_num, chan); msg =iop_alloc_msg (); msg->iop_num = iop_num;
@@ -454,13 +456,14 @@ static void iop_handle_recv(uint iop_num, uint chan)if (msg->handler) { (*msg->handler)(msg); }else { +pr_iop ("iop_handle_recv: unclaimed message on iop %d channel %d\n" , + iop_num, chan);#ifdef DEBUG_IOP -printk ("iop_handle_recv: unclaimed message on iop %d channel %d\n" , iop_num, chan); -printk ("iop_handle_recv:" ); +pr_iop ("iop_handle_recv:" );for (i =0 ; i <IOP_MSG_LEN ; i++) { -printk (" %02X" , (uint ) msg->message[i]); +pr_cont (" %02X" , msg->message[i]); } -printk ("\n" ); +pr_iop_cont ("\n" );#endif iop_complete_message (msg); }
@@ -574,50 +577,36 @@ irqreturn_t iop_ism_irq(int irq, void *dev_id)volatile struct mac_iop *iop = iop_base[iop_num];int i,state; -#ifdef DEBUG_IOP -printk ("iop_ism_irq: status = %02X\n" , (uint ) iop->status_ctrl); -#endif +pr_iop ("iop_ism_irq: status = %02X\n" , iop->status_ctrl);/* INT0 indicates a state change on an outgoing message channel */ if (iop->status_ctrl &IOP_INT0 ) { iop->status_ctrl =IOP_INT0 |IOP_RUN |IOP_AUTOINC ; -#ifdef DEBUG_IOP -printk ("iop_ism_irq: new status = %02X, send states" , - (uint ) iop->status_ctrl); -#endif +pr_iop ("iop_ism_irq: new status = %02X, send states" , + iop->status_ctrl);for (i =0 ; i <NUM_IOP_CHAN ; i++) { state =iop_readb (iop,IOP_ADDR_SEND_STATE + i); -#ifdef DEBUG_IOP -printk (" %02X" , state); -#endif +pr_iop_cont (" %02X" , state);if (state ==IOP_MSG_COMPLETE ) {iop_handle_send (iop_num, i); } } -#ifdef DEBUG_IOP -printk ("\n" ); -#endif +pr_iop_cont ("\n" ); }if (iop->status_ctrl &IOP_INT1 ) {/* INT1 for incoming msgs */ iop->status_ctrl =IOP_INT1 |IOP_RUN |IOP_AUTOINC ; -#ifdef DEBUG_IOP -printk ("iop_ism_irq: new status = %02X, recv states" , - (uint ) iop->status_ctrl); -#endif +pr_iop ("iop_ism_irq: new status = %02X, recv states" , + iop->status_ctrl);for (i =0 ; i <NUM_IOP_CHAN ; i++) { state =iop_readb (iop,IOP_ADDR_RECV_STATE + i); -#ifdef DEBUG_IOP -printk (" %02X" , state); -#endif +pr_iop_cont (" %02X" , state);if (state ==IOP_MSG_NEW ) {iop_handle_recv (iop_num, i); } } -#ifdef DEBUG_IOP -printk ("\n" ); -#endif +pr_iop_cont ("\n" ); }return IRQ_HANDLED ; }
Signature · 1 line
1.9.1
Re: [PATCH 08/22] m68k/mac: iop - Modernize printing of kernel messages
Quoted 16 lines · Geert Uytterhoeven
- Introduce helpers for printing debug messages, incl. dummies for validating format strings when debugging is disabled,
- Convert fromprintk()to pr_*(),
- Add missing continuations,
- Drop superfluous casts.Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/mac/iop.c | 69 ++++++++++++++++++++++------------------------------- 1 file changed, 29 insertions(+), 40 deletions(-)arch/m68k/mac/iop.c +0
-0
arch/m68k/mac/iop.c line 119
Quoted 4 lines
arch/m68k/mac/iop.c +1
-0@@ -116,6 +116,13 @@#include <asm/mac_iop.h> /*#define DEBUG_IOP*/ +#ifdef DEBUG_IOP
We can use #if 0 here, since the macro can be avoided later...
Quoted 77 lines
arch/m68k/mac/iop.c +16
-15+#define pr_iop (fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#define pr_iop_cont (fmt, ...) pr_cont(fmt, ##__VA_ARGS__) +#else +#define pr_iop (fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#define pr_iop_cont (fmt, ...) no_printk(fmt, ##__VA_ARGS__) +#endif /* Non-zero if the IOPs are present */ @@ -268,10 +275,10 @@ void __init iop_init(void)int i;if (iop_scc_present) { -printk ("IOP: detected SCC IOP at %p\n" , iop_base[IOP_NUM_SCC ]); +pr_info ("IOP: detected SCC IOP at %p\n" , iop_base[IOP_NUM_SCC ]); }if (iop_ism_present) { -printk ("IOP: detected ISM IOP at %p\n" , iop_base[IOP_NUM_ISM ]); +pr_info ("IOP: detected ISM IOP at %p\n" , iop_base[IOP_NUM_ISM ]);iop_start (iop_base[IOP_NUM_ISM ]);iop_alive (iop_base[IOP_NUM_ISM ]);/* clears the alive flag */ }@@ -310,9 +317,9 @@ void __init iop_register_interrupts(void)pr_err ("Couldn't register ISM IOP interrupt\n" ); }if (!iop_alive (iop_base[IOP_NUM_ISM ])) { -printk ("IOP: oh my god, they killed the ISM IOP!\n" ); +pr_warn ("IOP: oh my god, they killed the ISM IOP!\n" ); }else { -printk ("IOP: the ISM IOP seems to be alive.\n" ); +pr_info ("IOP: the ISM IOP seems to be alive.\n" ); } } }@@ -349,9 +356,8 @@ void iop_complete_message(struct iop_msg *msg)int chan = msg->channel;int i,offset; -#ifdef DEBUG_IOP -printk ("iop_complete(%p): iop %d chan %d\n" , msg, msg->iop_num, msg->channel); -#endif +pr_iop ("iop_complete(%p): iop %d chan %d\n" , msg, msg->iop_num, + msg->channel); offset =IOP_ADDR_RECV_MSG + (msg->channel *IOP_MSG_LEN );@@ -397,9 +403,7 @@ static void iop_handle_send(uint iop_num, uint chan)struct iop_msg *msg,*msg2;int i,offset; -#ifdef DEBUG_IOP -printk ("iop_handle_send: iop %d channel %d\n" , iop_num, chan); -#endif +pr_iop ("iop_handle_send: iop %d channel %d\n" , iop_num, chan);iop_writeb (iop,IOP_ADDR_SEND_STATE + chan,IOP_MSG_IDLE );@@ -430,9 +434,7 @@ static void iop_handle_recv(uint iop_num, uint chan)int i,offset;struct iop_msg *msg; -#ifdef DEBUG_IOP -printk ("iop_handle_recv: iop %d channel %d\n" , iop_num, chan); -#endif +pr_iop ("iop_handle_recv: iop %d channel %d\n" , iop_num, chan); msg =iop_alloc_msg (); msg->iop_num = iop_num;@@ -454,13 +456,14 @@ static void iop_handle_recv(uint iop_num, uint chan)if (msg->handler) { (*msg->handler)(msg); }else { +pr_iop ("iop_handle_recv: unclaimed message on iop %d channel %d\n" , + iop_num, chan);#ifdef DEBUG_IOP -printk ("iop_handle_recv: unclaimed message on iop %d channel %d\n" , iop_num, chan); -printk ("iop_handle_recv:" );
arch/m68k/mac/iop.c static void iop_handle_recv(uint iop_num, uint chan) · line 469
Quoted 10 lines
arch/m68k/mac/iop.c +3
-2+pr_iop ("iop_handle_recv:" );for (i =0 ; i <IOP_MSG_LEN ; i++) { -printk (" %02X" , (uint ) msg->message[i]); +pr_cont (" %02X" , msg->message[i]); } -printk ("\n" ); +pr_iop_cont ("\n" );#endif iop_complete_message (msg); }
I think you can avoid the DEBUG_IOP macro entirely, by using
pr_iop("iop_handle_recv: %*ph\n", IOP_MSG_LEN, msg->message);Thanks.
Quoted 61 lines
arch/m68k/mac/iop.c +9
-23@@ -574,50 +577,36 @@ irqreturn_t iop_ism_irq(int irq, void *dev_id)volatile struct mac_iop *iop = iop_base[iop_num];int i,state; -#ifdef DEBUG_IOP -printk ("iop_ism_irq: status = %02X\n" , (uint ) iop->status_ctrl); -#endif +pr_iop ("iop_ism_irq: status = %02X\n" , iop->status_ctrl);/* INT0 indicates a state change on an outgoing message channel */ if (iop->status_ctrl &IOP_INT0 ) { iop->status_ctrl =IOP_INT0 |IOP_RUN |IOP_AUTOINC ; -#ifdef DEBUG_IOP -printk ("iop_ism_irq: new status = %02X, send states" , - (uint ) iop->status_ctrl); -#endif +pr_iop ("iop_ism_irq: new status = %02X, send states" , + iop->status_ctrl);for (i =0 ; i <NUM_IOP_CHAN ; i++) { state =iop_readb (iop,IOP_ADDR_SEND_STATE + i); -#ifdef DEBUG_IOP -printk (" %02X" , state); -#endif +pr_iop_cont (" %02X" , state);if (state ==IOP_MSG_COMPLETE ) {iop_handle_send (iop_num, i); } } -#ifdef DEBUG_IOP -printk ("\n" ); -#endif +pr_iop_cont ("\n" ); }if (iop->status_ctrl &IOP_INT1 ) {/* INT1 for incoming msgs */ iop->status_ctrl =IOP_INT1 |IOP_RUN |IOP_AUTOINC ; -#ifdef DEBUG_IOP -printk ("iop_ism_irq: new status = %02X, recv states" , - (uint ) iop->status_ctrl); -#endif +pr_iop ("iop_ism_irq: new status = %02X, recv states" , + iop->status_ctrl);for (i =0 ; i <NUM_IOP_CHAN ; i++) { state =iop_readb (iop,IOP_ADDR_RECV_STATE + i); -#ifdef DEBUG_IOP -printk (" %02X" , state); -#endif +pr_iop_cont (" %02X" , state);if (state ==IOP_MSG_NEW ) {iop_handle_recv (iop_num, i); } } -#ifdef DEBUG_IOP -printk ("\n" ); -#endif +pr_iop_cont ("\n" ); }return IRQ_HANDLED ; }
Geert Uytterhoeven
maintainerPATCH 9/22 m68k/mac: oss - Modernize printing of kernel messages
In reply to Geert UytterhoevenConvert from printk() to pr_*().
- Introduce helpers for printing debug messages, incl. dummies for validating format strings when debugging is disabled,
- Convert from printk() to pr_*(),
- Drop superfluous casts,
- Add linebreaks before opening braces of function bodies.
--- arch/m68k/mac/oss.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-)
arch/m68k/mac/oss.c +15 -11
@@ -26,6 +26,12 @@#include <asm/mac_via.h> #include <asm/mac_oss.h> +#ifdef DEBUG_IRQS +#define pr_irq (fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#else +#define pr_irq (fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#endif +int oss_present;volatile struct mac_oss *oss;
@@ -72,8 +78,8 @@ static void oss_irq(struct irq_desc *desc)if ((console_loglevel ==10 ) && !(events &OSS_IP_SCSI )) {unsigned int irq =irq_desc_get_irq (desc); -printk ("oss_irq: irq %u events = 0x%04X\n" , irq, - (int ) oss->irq_pending); +pr_irq ("oss_irq: irq %u events = 0x%04X\n" , irq, + oss->irq_pending); }#endif
@@ -109,7 +115,7 @@ static void oss_nubus_irq(struct irq_desc *desc)#ifdef DEBUG_NUBUS_INT if (console_loglevel >7 ) { -printk ("oss_nubus_irq: events = 0x%04X\n" , events); +pr_info ("oss_nubus_irq: events = 0x%04X\n" , events); }#endif /* There are only six slots on the OSS, not seven */
@@ -162,10 +168,9 @@ void __init oss_register_interrupts(void)* level for that source to nonzero, thus enabling the interrupt. */ -void oss_irq_enable (int irq) { -#ifdef DEBUG_IRQUSE -printk ("oss_irq_enable(%d)\n" , irq); -#endif +void oss_irq_enable (int irq) +{ +pr_irq ("oss_irq_enable(%d)\n" , irq);switch (irq) {case IRQ_MAC_SCC : oss->irq_level[OSS_IOPSCC ] =OSS_IRQLEV_IOPSCC ;
@@ -198,10 +203,9 @@ void oss_irq_enable(int irq) {* to disable the interrupt. */ -void oss_irq_disable (int irq) { -#ifdef DEBUG_IRQUSE -printk ("oss_irq_disable(%d)\n" , irq); -#endif +void oss_irq_disable (int irq) +{ +pr_irq ("oss_irq_disable(%d)\n" , irq);switch (irq) {case IRQ_MAC_SCC : oss->irq_level[OSS_IOPSCC ] =0 ;
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 9/22 m68k/mac: oss - Modernize printing of kernel messages
In reply to Geert UytterhoevenConvert from printk() to pr_*().
- Introduce helpers for printing debug messages, incl. dummies for validating format strings when debugging is disabled,
- Convert from printk() to pr_*(),
- Drop superfluous casts,
- Add linebreaks before opening braces of function bodies.
--- arch/m68k/mac/oss.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-)
arch/m68k/mac/oss.c +15 -11
@@ -26,6 +26,12 @@#include <asm/mac_via.h> #include <asm/mac_oss.h> +#ifdef DEBUG_IRQS +#define pr_irq (fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#else +#define pr_irq (fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#endif +int oss_present;volatile struct mac_oss *oss;
@@ -72,8 +78,8 @@ static void oss_irq(struct irq_desc *desc)if ((console_loglevel ==10 ) && !(events &OSS_IP_SCSI )) {unsigned int irq =irq_desc_get_irq (desc); -printk ("oss_irq: irq %u events = 0x%04X\n" , irq, - (int ) oss->irq_pending); +pr_irq ("oss_irq: irq %u events = 0x%04X\n" , irq, + oss->irq_pending); }#endif
@@ -109,7 +115,7 @@ static void oss_nubus_irq(struct irq_desc *desc)#ifdef DEBUG_NUBUS_INT if (console_loglevel >7 ) { -printk ("oss_nubus_irq: events = 0x%04X\n" , events); +pr_info ("oss_nubus_irq: events = 0x%04X\n" , events); }#endif /* There are only six slots on the OSS, not seven */
@@ -162,10 +168,9 @@ void __init oss_register_interrupts(void)* level for that source to nonzero, thus enabling the interrupt. */ -void oss_irq_enable (int irq) { -#ifdef DEBUG_IRQUSE -printk ("oss_irq_enable(%d)\n" , irq); -#endif +void oss_irq_enable (int irq) +{ +pr_irq ("oss_irq_enable(%d)\n" , irq);switch (irq) {case IRQ_MAC_SCC : oss->irq_level[OSS_IOPSCC ] =OSS_IRQLEV_IOPSCC ;
@@ -198,10 +203,9 @@ void oss_irq_enable(int irq) {* to disable the interrupt. */ -void oss_irq_disable (int irq) { -#ifdef DEBUG_IRQUSE -printk ("oss_irq_disable(%d)\n" , irq); -#endif +void oss_irq_disable (int irq) +{ +pr_irq ("oss_irq_disable(%d)\n" , irq);switch (irq) {case IRQ_MAC_SCC : oss->irq_level[OSS_IOPSCC ] =0 ;
Signature · 1 line
1.9.1
Re: [PATCH 09/22] m68k/mac: oss - Modernize printing of kernel messages
Quoted 20 lines · Geert Uytterhoeven
Convert from
printk()to pr_*().- Introduce helpers for printing debug messages, incl. dummies for validating format strings when debugging is disabled,
- Convert fromprintk()to pr_*(),
- Drop superfluous casts,
- Add linebreaks before opening braces of function bodies.Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/mac/oss.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-)arch/m68k/mac/oss.c +0
-0@@ -26,6 +26,12 @@#include <asm/mac_via.h> #include <asm/mac_oss.h>
arch/m68k/mac/oss.c line 37
Quoted 10 lines
arch/m68k/mac/oss.c +6
-0+#ifdef DEBUG_IRQS +#define pr_irq (fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#else +#define pr_irq (fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#endif +int oss_present;volatile struct mac_oss *oss;
Please just remove the DEBUG_IRQS macro and the related output.
Quoted 12 lines
arch/m68k/mac/oss.c +2
-2@@ -72,8 +78,8 @@ static void oss_irq(struct irq_desc *desc)if ((console_loglevel ==10 ) && !(events &OSS_IP_SCSI )) {unsigned int irq =irq_desc_get_irq (desc); -printk ("oss_irq: irq %u events = 0x%04X\n" , irq, - (int ) oss->irq_pending); +pr_irq ("oss_irq: irq %u events = 0x%04X\n" , irq, + oss->irq_pending); }#endif
arch/m68k/mac/oss.c static void oss_nubus_irq(struct irq_desc *desc) · line 121
Quoted 8 lines
arch/m68k/mac/oss.c +1
-1@@ -109,7 +115,7 @@ static void oss_nubus_irq(struct irq_desc *desc)#ifdef DEBUG_NUBUS_INT if (console_loglevel >7 ) { -printk ("oss_nubus_irq: events = 0x%04X\n" , events); +pr_info ("oss_nubus_irq: events = 0x%04X\n" , events); }#endif /* There are only six slots on the OSS, not seven */
Same with DEBUG_NUBUS_INT.
Thanks.
Quoted 29 lines
arch/m68k/mac/oss.c +6
-8@@ -162,10 +168,9 @@ void __init oss_register_interrupts(void)* level for that source to nonzero, thus enabling the interrupt. */ -void oss_irq_enable (int irq) { -#ifdef DEBUG_IRQUSE -printk ("oss_irq_enable(%d)\n" , irq); -#endif +void oss_irq_enable (int irq) +{ +pr_irq ("oss_irq_enable(%d)\n" , irq);switch (irq) {case IRQ_MAC_SCC : oss->irq_level[OSS_IOPSCC ] =OSS_IRQLEV_IOPSCC ;@@ -198,10 +203,9 @@ void oss_irq_enable(int irq) {* to disable the interrupt. */ -void oss_irq_disable (int irq) { -#ifdef DEBUG_IRQUSE -printk ("oss_irq_disable(%d)\n" , irq); -#endif +void oss_irq_disable (int irq) +{ +pr_irq ("oss_irq_disable(%d)\n" , irq);switch (irq) {case IRQ_MAC_SCC : oss->irq_level[OSS_IOPSCC ] =0 ;
Geert Uytterhoeven
maintainerPATCH 10/22 m68k/mac: psc - Modernize printing of kernel messages
In reply to Geert Uytterhoeven - Introduce helpers for printing debug messages, incl. dummies for validating format strings when debugging is disabled,
- Convert from printk() to pr_*(),
- Add missing continuations,
- Drop superfluous casts.
--- arch/m68k/mac/psc.c | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-)
arch/m68k/mac/psc.c +15 -17
@@ -26,6 +26,11 @@#include <asm/mac_psc.h> #define DEBUG_PSC +#ifdef DEBUG_IRQS +#define pr_irq (fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#else +#define pr_irq (fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#endif volatile __u8 *psc;EXPORT_SYMBOL_GPL (psc);
@@ -42,10 +47,9 @@ static void psc_debug_dump(void)return ;for (i =0x30 ; i <0x70 ; i +=0x10 ) { -printk ("PSC #%d: IFR = 0x%02X IER = 0x%02X\n" , - i >>4 , - (int )psc_read_byte (pIFRbase + i), - (int )psc_read_byte (pIERbase + i)); +pr_info ("PSC #%d: IFR = 0x%02X IER = 0x%02X\n" , i >>4 , +psc_read_byte (pIFRbase + i), +psc_read_byte (pIERbase + i)); } }
@@ -59,14 +63,14 @@ static __init void psc_dma_die_die_die(void) {int i; -printk ("Killing all PSC DMA channels..." ); +pr_info ("Killing all PSC DMA channels..." );for (i =0 ; i <9 ; i++) {psc_write_word (PSC_CTL_BASE + (i <<4 ),0x8800 );psc_write_word (PSC_CTL_BASE + (i <<4 ),0x1000 );psc_write_word (PSC_CMD_BASE + (i <<5 ),0x1100 );psc_write_word (PSC_CMD_BASE + (i <<5 ) +0x10 ,0x1100 ); } -printk ("done!\n" ); +pr_cont ("done!\n" ); }/*
@@ -92,7 +96,7 @@ void __init psc_init(void) psc = (void *)PSC_BASE ; -printk ("PSC detected at %p\n" , psc); +pr_info ("PSC detected at %p\n" , psc);psc_dma_die_die_die ();
@@ -122,10 +126,8 @@ static void psc_irq(struct irq_desc *desc)int irq_num;unsigned char irq_bit, events; -#ifdef DEBUG_IRQS -printk ("psc_irq: irq %u pIFR = 0x%02X pIER = 0x%02X\n" , - irq, (int )psc_read_byte (pIFR), (int )psc_read_byte (pIER)); -#endif +pr_irq ("psc_irq: irq %u pIFR = 0x%02X pIER = 0x%02X\n" , irq, +psc_read_byte (pIFR),psc_read_byte (pIER)); events =psc_read_byte (pIFR) &psc_read_byte (pIER) &0xF ;if (!events)
@@ -160,9 +162,7 @@ void psc_irq_enable(int irq) {int irq_idx =IRQ_IDX (irq);int pIER = pIERbase + (irq_src <<4 ); -#ifdef DEBUG_IRQUSE -printk ("psc_irq_enable(%d)\n" , irq); -#endif +pr_irq ("psc_irq_enable(%d)\n" , irq);psc_write_byte (pIER, (1 << irq_idx) |0x80 ); }
@@ -171,8 +171,6 @@ void psc_irq_disable(int irq) {int irq_idx =IRQ_IDX (irq);int pIER = pIERbase + (irq_src <<4 ); -#ifdef DEBUG_IRQUSE -printk ("psc_irq_disable(%d)\n" , irq); -#endif +pr_irq ("psc_irq_disable(%d)\n" , irq);psc_write_byte (pIER,1 << irq_idx); }
Signature · 1 line
1.9.1
Re: [PATCH 10/22] m68k/mac: psc - Modernize printing of kernel messages
Quoted 17 lines · Geert Uytterhoeven
- Introduce helpers for printing debug messages, incl. dummies for validating format strings when debugging is disabled,
- Convert fromprintk()to pr_*(),
- Add missing continuations,
- Drop superfluous casts.Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/mac/psc.c | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-)arch/m68k/mac/psc.c +0
-0@@ -26,6 +26,11 @@#include <asm/mac_psc.h>
arch/m68k/mac/psc.c line 36
Quoted 10 lines
arch/m68k/mac/psc.c +5
-0#define DEBUG_PSC +#ifdef DEBUG_IRQS +#define pr_irq (fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#else +#define pr_irq (fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#endif volatile __u8 *psc;EXPORT_SYMBOL_GPL (psc);
Please remove the DEBUG_IRQS messages and macro.
Quoted 66 lines
arch/m68k/mac/psc.c +9
-14@@ -42,10 +47,9 @@ static void psc_debug_dump(void)return ;for (i =0x30 ; i <0x70 ; i +=0x10 ) { -printk ("PSC #%d: IFR = 0x%02X IER = 0x%02X\n" , - i >>4 , - (int )psc_read_byte (pIFRbase + i), - (int )psc_read_byte (pIERbase + i)); +pr_info ("PSC #%d: IFR = 0x%02X IER = 0x%02X\n" , i >>4 , +psc_read_byte (pIFRbase + i), +psc_read_byte (pIERbase + i)); } }@@ -59,14 +63,14 @@ static __init void psc_dma_die_die_die(void) {int i; -printk ("Killing all PSC DMA channels..." ); +pr_info ("Killing all PSC DMA channels..." );for (i =0 ; i <9 ; i++) {psc_write_word (PSC_CTL_BASE + (i <<4 ),0x8800 );psc_write_word (PSC_CTL_BASE + (i <<4 ),0x1000 );psc_write_word (PSC_CMD_BASE + (i <<5 ),0x1100 );psc_write_word (PSC_CMD_BASE + (i <<5 ) +0x10 ,0x1100 ); } -printk ("done!\n" ); +pr_cont ("done!\n" ); }/* @@ -92,7 +96,7 @@ void __init psc_init(void) psc = (void *)PSC_BASE ; -printk ("PSC detected at %p\n" , psc); +pr_info ("PSC detected at %p\n" , psc);psc_dma_die_die_die ();@@ -122,10 +126,8 @@ static void psc_irq(struct irq_desc *desc)int irq_num;unsigned char irq_bit, events; -#ifdef DEBUG_IRQS -printk ("psc_irq: irq %u pIFR = 0x%02X pIER = 0x%02X\n" , - irq, (int )psc_read_byte (pIFR), (int )psc_read_byte (pIER)); -#endif +pr_irq ("psc_irq: irq %u pIFR = 0x%02X pIER = 0x%02X\n" , irq, +psc_read_byte (pIFR),psc_read_byte (pIER)); events =psc_read_byte (pIFR) &psc_read_byte (pIER) &0xF ;if (!events)@@ -160,9 +162,7 @@ void psc_irq_enable(int irq) {int irq_idx =IRQ_IDX (irq);int pIER = pIERbase + (irq_src <<4 ); -#ifdef DEBUG_IRQUSE -printk ("psc_irq_enable(%d)\n" , irq); -#endif +pr_irq ("psc_irq_enable(%d)\n" , irq);psc_write_byte (pIER, (1 << irq_idx) |0x80 ); }
arch/m68k/mac/psc.c void psc_irq_disable(int irq) { · line 176
Quoted 9 lines
arch/m68k/mac/psc.c +1
-3@@ -171,8 +171,6 @@ void psc_irq_disable(int irq) {int irq_idx =IRQ_IDX (irq);int pIER = pIERbase + (irq_src <<4 ); -#ifdef DEBUG_IRQUSE -printk ("psc_irq_disable(%d)\n" , irq); -#endif +pr_irq ("psc_irq_disable(%d)\n" , irq);psc_write_byte (pIER,1 << irq_idx); }
Same for DEBUG_IRQUSE.
Thanks.
Re: [PATCH 10/22] m68k/mac: psc - Modernize printing of kernel messages
In reply to Geert UytterhoevenQuoted 17 lines · Geert Uytterhoeven
- Introduce helpers for printing debug messages, incl. dummies for validating format strings when debugging is disabled,
- Convert fromprintk()to pr_*(),
- Add missing continuations,
- Drop superfluous casts.Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/mac/psc.c | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-)arch/m68k/mac/psc.c +0
-0@@ -26,6 +26,11 @@#include <asm/mac_psc.h>
arch/m68k/mac/psc.c line 36
Quoted 10 lines
arch/m68k/mac/psc.c +5
-0#define DEBUG_PSC +#ifdef DEBUG_IRQS +#define pr_irq (fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#else +#define pr_irq (fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#endif volatile __u8 *psc;EXPORT_SYMBOL_GPL (psc);
Please remove the DEBUG_IRQS messages and macro.
Quoted 66 lines
arch/m68k/mac/psc.c +9
-14@@ -42,10 +47,9 @@ static void psc_debug_dump(void)return ;for (i =0x30 ; i <0x70 ; i +=0x10 ) { -printk ("PSC #%d: IFR = 0x%02X IER = 0x%02X\n" , - i >>4 , - (int )psc_read_byte (pIFRbase + i), - (int )psc_read_byte (pIERbase + i)); +pr_info ("PSC #%d: IFR = 0x%02X IER = 0x%02X\n" , i >>4 , +psc_read_byte (pIFRbase + i), +psc_read_byte (pIERbase + i)); } }@@ -59,14 +63,14 @@ static __init void psc_dma_die_die_die(void) {int i; -printk ("Killing all PSC DMA channels..." ); +pr_info ("Killing all PSC DMA channels..." );for (i =0 ; i <9 ; i++) {psc_write_word (PSC_CTL_BASE + (i <<4 ),0x8800 );psc_write_word (PSC_CTL_BASE + (i <<4 ),0x1000 );psc_write_word (PSC_CMD_BASE + (i <<5 ),0x1100 );psc_write_word (PSC_CMD_BASE + (i <<5 ) +0x10 ,0x1100 ); } -printk ("done!\n" ); +pr_cont ("done!\n" ); }/* @@ -92,7 +96,7 @@ void __init psc_init(void) psc = (void *)PSC_BASE ; -printk ("PSC detected at %p\n" , psc); +pr_info ("PSC detected at %p\n" , psc);psc_dma_die_die_die ();@@ -122,10 +126,8 @@ static void psc_irq(struct irq_desc *desc)int irq_num;unsigned char irq_bit, events; -#ifdef DEBUG_IRQS -printk ("psc_irq: irq %u pIFR = 0x%02X pIER = 0x%02X\n" , - irq, (int )psc_read_byte (pIFR), (int )psc_read_byte (pIER)); -#endif +pr_irq ("psc_irq: irq %u pIFR = 0x%02X pIER = 0x%02X\n" , irq, +psc_read_byte (pIFR),psc_read_byte (pIER)); events =psc_read_byte (pIFR) &psc_read_byte (pIER) &0xF ;if (!events)@@ -160,9 +162,7 @@ void psc_irq_enable(int irq) {int irq_idx =IRQ_IDX (irq);int pIER = pIERbase + (irq_src <<4 ); -#ifdef DEBUG_IRQUSE -printk ("psc_irq_enable(%d)\n" , irq); -#endif +pr_irq ("psc_irq_enable(%d)\n" , irq);psc_write_byte (pIER, (1 << irq_idx) |0x80 ); }
arch/m68k/mac/psc.c void psc_irq_disable(int irq) { · line 176
Quoted 9 lines
arch/m68k/mac/psc.c +1
-3@@ -171,8 +171,6 @@ void psc_irq_disable(int irq) {int irq_idx =IRQ_IDX (irq);int pIER = pIERbase + (irq_src <<4 ); -#ifdef DEBUG_IRQUSE -printk ("psc_irq_disable(%d)\n" , irq); -#endif +pr_irq ("psc_irq_disable(%d)\n" , irq);psc_write_byte (pIER,1 << irq_idx); }
Same for DEBUG_IRQUSE.
Thanks.
Geert Uytterhoeven
maintainerPATCH 11/22 m68k/mac: Modernize printing of kernel messages
In reply to Geert UytterhoevenConvert from printk() to pr_*().
--- arch/m68k/mac/config.c | 34 ++++++++++++++++------------------ arch/m68k/mac/misc.c | 8 ++++---- 2 files changed, 20 insertions(+), 22 deletions(-)
arch/m68k/mac/config.c +16 -18
@@ -150,7 +150,7 @@ static void mac_cache_card_flush(int writeback)void __init config_mac (void ) {if (!MACH_IS_MAC ) -printk (KERN_ERR "ERROR: no Mac, but config_mac() called!!\n" ); +pr_err ("ERROR: no Mac, but config_mac() called!!\n" ); mach_sched_init = mac_sched_init; mach_init_IRQ = mac_init_IRQ;
@@ -837,8 +837,7 @@ static void __init mac_identify(void)/* no bootinfo model id -> NetBSD booter was used! */ /* XXX FIXME: breaks for model > 31 */ model = (mac_bi_data.cpuid >>2 ) &63 ; -printk (KERN_WARNING "No bootinfo model ID, using cpuid instead " -"(obsolete bootloader?)\n" ); +pr_warn ("No bootinfo model ID, using cpuid instead (obsolete bootloader?)\n" ); } macintosh_config = mac_data_table;
@@ -880,24 +879,23 @@ static void __init mac_identify(void)*/ iop_preinit (); -printk (KERN_INFO "Detected Macintosh model: %d\n" , model); +pr_info ("Detected Macintosh model: %d\n" , model);/* * Report booter data: */ -printk (KERN_DEBUG " Penguin bootinfo data:\n" ); -printk (KERN_DEBUG " Video: addr 0x%lx " -"row 0x%lx depth %lx dimensions %ld x %ld\n" , - mac_bi_data.videoaddr, mac_bi_data.videorow, - mac_bi_data.videodepth, mac_bi_data.dimensions &0xFFFF , - mac_bi_data.dimensions >>16 ); -printk (KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx\n" , - mac_bi_data.videological, mac_orig_videoaddr, - mac_bi_data.sccbase); -printk (KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx\n" , - mac_bi_data.boottime, mac_bi_data.gmtbias); -printk (KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx\n" , - mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize); +pr_debug (" Penguin bootinfo data:\n" ); +pr_debug (" Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n" , + mac_bi_data.videoaddr, mac_bi_data.videorow, + mac_bi_data.videodepth, mac_bi_data.dimensions &0xFFFF , + mac_bi_data.dimensions >>16 ); +pr_debug (" Videological 0x%lx phys. 0x%lx, SCC at 0x%lx\n" , + mac_bi_data.videological, mac_orig_videoaddr, + mac_bi_data.sccbase); +pr_debug (" Boottime: 0x%lx GMTBias: 0x%lx\n" , mac_bi_data.boottime, + mac_bi_data.gmtbias); +pr_debug (" Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx\n" , + mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);iop_init ();via_init ();
@@ -912,7 +910,7 @@ static void __init mac_identify(void)static void __init mac_report_hardware (void ) { -printk (KERN_INFO "Apple Macintosh %s\n" , macintosh_config->name); +pr_info ("Apple Macintosh %s\n" , macintosh_config->name); }static void mac_get_model (char *str)
arch/m68k/mac/misc.c +4 -4
@@ -520,7 +520,7 @@ void mac_poweroff(void)#endif }local_irq_enable (); -printk ("It is now safe to turn off your Macintosh.\n" ); +pr_info ("It is now safe to turn off your Macintosh.\n" );while (1 ); }
@@ -610,7 +610,7 @@ void mac_reset(void)/* should never get here */ local_irq_enable (); -printk ("Restart failed. Please restart manually.\n" ); +pr_err ("Restart failed. Please restart manually.\n" );while (1 ); }
@@ -718,13 +718,13 @@ int mac_hwclk(int op, struct rtc_time *t) &t->tm_year, &t->tm_mon, &t->tm_mday, &t->tm_hour, &t->tm_min, &t->tm_sec);#if 0 -printk ("mac_hwclk: read %04d-%02d-%-2d %02d:%02d:%02d\n" , +pr_info ("mac_hwclk: read %04d-%02d-%-2d %02d:%02d:%02d\n" , t->tm_year +1900 , t->tm_mon +1 , t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);#endif }else {/* write */ #if 0 -printk ("mac_hwclk: tried to write %04d-%02d-%-2d %02d:%02d:%02d\n" , +pr_info ("mac_hwclk: tried to write %04d-%02d-%-2d %02d:%02d:%02d\n" , t->tm_year +1900 , t->tm_mon +1 , t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);#endif
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 11/22 m68k/mac: Modernize printing of kernel messages
In reply to Geert UytterhoevenConvert from printk() to pr_*().
--- arch/m68k/mac/config.c | 34 ++++++++++++++++------------------ arch/m68k/mac/misc.c | 8 ++++---- 2 files changed, 20 insertions(+), 22 deletions(-)
arch/m68k/mac/config.c +16 -18
@@ -150,7 +150,7 @@ static void mac_cache_card_flush(int writeback)void __init config_mac (void ) {if (!MACH_IS_MAC ) -printk (KERN_ERR "ERROR: no Mac, but config_mac() called!!\n" ); +pr_err ("ERROR: no Mac, but config_mac() called!!\n" ); mach_sched_init = mac_sched_init; mach_init_IRQ = mac_init_IRQ;
@@ -837,8 +837,7 @@ static void __init mac_identify(void)/* no bootinfo model id -> NetBSD booter was used! */ /* XXX FIXME: breaks for model > 31 */ model = (mac_bi_data.cpuid >>2 ) &63 ; -printk (KERN_WARNING "No bootinfo model ID, using cpuid instead " -"(obsolete bootloader?)\n" ); +pr_warn ("No bootinfo model ID, using cpuid instead (obsolete bootloader?)\n" ); } macintosh_config = mac_data_table;
@@ -880,24 +879,23 @@ static void __init mac_identify(void)*/ iop_preinit (); -printk (KERN_INFO "Detected Macintosh model: %d\n" , model); +pr_info ("Detected Macintosh model: %d\n" , model);/* * Report booter data: */ -printk (KERN_DEBUG " Penguin bootinfo data:\n" ); -printk (KERN_DEBUG " Video: addr 0x%lx " -"row 0x%lx depth %lx dimensions %ld x %ld\n" , - mac_bi_data.videoaddr, mac_bi_data.videorow, - mac_bi_data.videodepth, mac_bi_data.dimensions &0xFFFF , - mac_bi_data.dimensions >>16 ); -printk (KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx\n" , - mac_bi_data.videological, mac_orig_videoaddr, - mac_bi_data.sccbase); -printk (KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx\n" , - mac_bi_data.boottime, mac_bi_data.gmtbias); -printk (KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx\n" , - mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize); +pr_debug (" Penguin bootinfo data:\n" ); +pr_debug (" Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n" , + mac_bi_data.videoaddr, mac_bi_data.videorow, + mac_bi_data.videodepth, mac_bi_data.dimensions &0xFFFF , + mac_bi_data.dimensions >>16 ); +pr_debug (" Videological 0x%lx phys. 0x%lx, SCC at 0x%lx\n" , + mac_bi_data.videological, mac_orig_videoaddr, + mac_bi_data.sccbase); +pr_debug (" Boottime: 0x%lx GMTBias: 0x%lx\n" , mac_bi_data.boottime, + mac_bi_data.gmtbias); +pr_debug (" Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx\n" , + mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);iop_init ();via_init ();
@@ -912,7 +910,7 @@ static void __init mac_identify(void)static void __init mac_report_hardware (void ) { -printk (KERN_INFO "Apple Macintosh %s\n" , macintosh_config->name); +pr_info ("Apple Macintosh %s\n" , macintosh_config->name); }static void mac_get_model (char *str)
arch/m68k/mac/misc.c +4 -4
@@ -520,7 +520,7 @@ void mac_poweroff(void)#endif }local_irq_enable (); -printk ("It is now safe to turn off your Macintosh.\n" ); +pr_info ("It is now safe to turn off your Macintosh.\n" );while (1 ); }
@@ -610,7 +610,7 @@ void mac_reset(void)/* should never get here */ local_irq_enable (); -printk ("Restart failed. Please restart manually.\n" ); +pr_err ("Restart failed. Please restart manually.\n" );while (1 ); }
@@ -718,13 +718,13 @@ int mac_hwclk(int op, struct rtc_time *t) &t->tm_year, &t->tm_mon, &t->tm_mday, &t->tm_hour, &t->tm_min, &t->tm_sec);#if 0 -printk ("mac_hwclk: read %04d-%02d-%-2d %02d:%02d:%02d\n" , +pr_info ("mac_hwclk: read %04d-%02d-%-2d %02d:%02d:%02d\n" , t->tm_year +1900 , t->tm_mon +1 , t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);#endif }else {/* write */ #if 0 -printk ("mac_hwclk: tried to write %04d-%02d-%-2d %02d:%02d:%02d\n" , +pr_info ("mac_hwclk: tried to write %04d-%02d-%-2d %02d:%02d:%02d\n" , t->tm_year +1900 , t->tm_mon +1 , t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);#endif
Signature · 1 line
1.9.1
Re: [PATCH 11/22] m68k/mac: Modernize printing of kernel messages
Quoted 13 lines · Geert Uytterhoeven
Convert from
printk()to pr_*().Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/mac/config.c | 34 ++++++++++++++++------------------ arch/m68k/mac/misc.c | 8 ++++---- 2 files changed, 20 insertions(+), 22 deletions(-)arch/m68k/mac/config.c +0
-0
arch/m68k/mac/config.c static void mac_cache_card_flush(int writeback) · line 156
Quoted 8 lines
arch/m68k/mac/config.c +1
-1@@ -150,7 +150,7 @@ static void mac_cache_card_flush(int writeback)void __init config_mac (void ) {if (!MACH_IS_MAC ) -printk (KERN_ERR "ERROR: no Mac, but config_mac() called!!\n" ); +pr_err ("ERROR: no Mac, but config_mac() called!!\n" ); mach_sched_init = mac_sched_init; mach_init_IRQ = mac_init_IRQ;
I think this printk is impossible to reach.
Quoted 38 lines
arch/m68k/mac/config.c +7
-16@@ -837,8 +837,7 @@ static void __init mac_identify(void)/* no bootinfo model id -> NetBSD booter was used! */ /* XXX FIXME: breaks for model > 31 */ model = (mac_bi_data.cpuid >>2 ) &63 ; -printk (KERN_WARNING "No bootinfo model ID, using cpuid instead " -"(obsolete bootloader?)\n" ); +pr_warn ("No bootinfo model ID, using cpuid instead (obsolete bootloader?)\n" ); } macintosh_config = mac_data_table;@@ -880,24 +879,23 @@ static void __init mac_identify(void)*/ iop_preinit (); -printk (KERN_INFO "Detected Macintosh model: %d\n" , model); +pr_info ("Detected Macintosh model: %d\n" , model);/* * Report booter data: */ -printk (KERN_DEBUG " Penguin bootinfo data:\n" ); -printk (KERN_DEBUG " Video: addr 0x%lx " -"row 0x%lx depth %lx dimensions %ld x %ld\n" , - mac_bi_data.videoaddr, mac_bi_data.videorow, - mac_bi_data.videodepth, mac_bi_data.dimensions &0xFFFF , - mac_bi_data.dimensions >>16 ); -printk (KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx\n" , - mac_bi_data.videological, mac_orig_videoaddr, - mac_bi_data.sccbase); -printk (KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx\n" , - mac_bi_data.boottime, mac_bi_data.gmtbias); -printk (KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx\n" , - mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize); +pr_debug (" Penguin bootinfo data:\n" ); +pr_debug (" Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n" , + mac_bi_data.videoaddr, mac_bi_data.videorow, + mac_bi_data.videodepth, mac_bi_data.dimensions &0xFFFF , + mac_bi_data.dimensions >>16 );
arch/m68k/mac/config.c static void __init mac_identify(void) · line 901
Quoted 10 lines
arch/m68k/mac/config.c +7
-0+pr_debug (" Videological 0x%lx phys. 0x%lx, SCC at 0x%lx\n" , + mac_bi_data.videological, mac_orig_videoaddr, + mac_bi_data.sccbase); +pr_debug (" Boottime: 0x%lx GMTBias: 0x%lx\n" , mac_bi_data.boottime, + mac_bi_data.gmtbias); +pr_debug (" Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx\n" , + mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);iop_init ();via_init ();
I'd prefer that these remained printk(KERN_DEBUG ...).
Quoted 38 lines
arch/m68k/mac/config.c +1
-1@@ -912,7 +910,7 @@ static void __init mac_identify(void)static void __init mac_report_hardware (void ) { -printk (KERN_INFO "Apple Macintosh %s\n" , macintosh_config->name); +pr_info ("Apple Macintosh %s\n" , macintosh_config->name); }static void mac_get_model (char *str)arch/m68k/mac/misc.c +3
-3@@ -520,7 +520,7 @@ void mac_poweroff(void)#endif }local_irq_enable (); -printk ("It is now safe to turn off your Macintosh.\n" ); +pr_info ("It is now safe to turn off your Macintosh.\n" );while (1 ); }@@ -610,7 +610,7 @@ void mac_reset(void)/* should never get here */ local_irq_enable (); -printk ("Restart failed. Please restart manually.\n" ); +pr_err ("Restart failed. Please restart manually.\n" );while (1 ); }@@ -718,13 +718,13 @@ int mac_hwclk(int op, struct rtc_time *t) &t->tm_year, &t->tm_mon, &t->tm_mday, &t->tm_hour, &t->tm_min, &t->tm_sec);#if 0 - printk("mac_hwclk: read %04d-%02d-%-2d %02d:%02d:%02d\n", + pr_info("mac_hwclk: read %04d-%02d-%-2d %02d:%02d:%02d\n",
arch/m68k/mac/misc.c int mac_hwclk(int op, struct rtc_time *t) · line 730
Quoted 10 lines
arch/m68k/mac/misc.c +1
-1t->tm_year +1900 , t->tm_mon +1 , t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);#endif }else {/* write */ #if 0 -printk ("mac_hwclk: tried to write %04d-%02d-%-2d %02d:%02d:%02d\n" , +pr_info ("mac_hwclk: tried to write %04d-%02d-%-2d %02d:%02d:%02d\n" , t->tm_year +1900 , t->tm_mon +1 , t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);#endif
These two can be changed to pr_debug() and the #if 0 removed. Since there is no DEBUG macro definition here, I believe they will become no_printk() and get checked by the compiler.
Thanks.
Geert Uytterhoeven
maintainerPATCH 12/22 m68k/mvme147: Modernize printing of kernel messages
In reply to Geert UytterhoevenConvert from printk() to pr_*().
--- arch/m68k/mvme147/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/m68k/mvme147/config.c +1 -1
@@ -63,7 +63,7 @@ int __init mvme147_parse_bootinfo(const struct bi_record *bi)void mvme147_reset (void ) { -printk ("\r\n\nCalled mvme147_reset\r\n" ); +pr_info ("\r\n\nCalled mvme147_reset\r\n" ); m147_pcc->watchdog =0x0a ;/* Clear timer */ m147_pcc->watchdog =0xa5 ;/* Enable watchdog - 100ms to reset */ while (1 )
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 12/22 m68k/mvme147: Modernize printing of kernel messages
In reply to Geert UytterhoevenConvert from printk() to pr_*().
--- arch/m68k/mvme147/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/m68k/mvme147/config.c +1 -1
@@ -63,7 +63,7 @@ int __init mvme147_parse_bootinfo(const struct bi_record *bi)void mvme147_reset (void ) { -printk ("\r\n\nCalled mvme147_reset\r\n" ); +pr_info ("\r\n\nCalled mvme147_reset\r\n" ); m147_pcc->watchdog =0x0a ;/* Clear timer */ m147_pcc->watchdog =0xa5 ;/* Enable watchdog - 100ms to reset */ while (1 )
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 13/22 m68k/mvme16x: Modernize printing of kernel messages
In reply to Geert UytterhoevenConvert from printk() to pr_*().
--- arch/m68k/mvme16x/config.c | 32 ++++++++++++++++---------------- arch/m68k/mvme16x/rtc.c | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-)
arch/m68k/mvme16x/config.c +16 -16
@@ -72,8 +72,8 @@ int __init mvme16x_parse_bootinfo(const struct bi_record *bi)void mvme16x_reset (void ) { -printk ("\r\n\nCalled mvme16x_reset\r\n" -"\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r" ); +pr_info ("\r\n\nCalled mvme16x_reset\r\n" +"\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r" );/* The string of returns is to delay the reset until the whole * message is output. Assert reset bit in GCSR */ *(volatile char *)0xfff40107 =0x80 ;
@@ -289,7 +289,7 @@ void __init config_mvme16x(void)if (strncmp ("BDID" , p->bdid,4 )) { -printk ("\n\nBug call .BRD_ID returned garbage - giving up\n\n" ); +pr_crit ("Bug call .BRD_ID returned garbage - giving up\n" );while (1 ) ; }
@@ -298,25 +298,25 @@ void __init config_mvme16x(void) vme_brdtype = brdno;mvme16x_get_model (id); -printk ("\nBRD_ID: %s BUG %x.%x %02x/%02x/%02x\n" , id, p->rev>>4 , - p->rev&0xf , p->yr, p->mth, p->day); +pr_info ("BRD_ID: %s BUG %x.%x %02x/%02x/%02x\n" , id, p->rev >>4 , + p->rev &0xf , p->yr, p->mth, p->day);if (brdno ==0x0162 || brdno ==0x172 ) {unsigned char rev = *(unsigned char *)MVME162_VERSION_REG ; mvme16x_config = rev | MVME16x_CONFIG_GOT_SCCA; -printk ("MVME%x Hardware status:\n" , brdno); -printk (" CPU Type 68%s040\n" , - rev & MVME16x_CONFIG_GOT_FPU ?"" :"LC" ); -printk (" CPU clock %dMHz\n" , - rev & MVME16x_CONFIG_SPEED_32 ?32 :25 ); -printk (" VMEchip2 %spresent\n" , - rev & MVME16x_CONFIG_NO_VMECHIP2 ?"NOT " :"" ); -printk (" SCSI interface %spresent\n" , - rev & MVME16x_CONFIG_NO_SCSICHIP ?"NOT " :"" ); -printk (" Ethernet interface %spresent\n" , - rev & MVME16x_CONFIG_NO_ETHERNET ?"NOT " :"" ); +pr_info ("MVME%x Hardware status:\n" , brdno); +pr_info (" CPU Type 68%s040\n" , + rev & MVME16x_CONFIG_GOT_FPU ?"" :"LC" ); +pr_info (" CPU clock %dMHz\n" , + rev & MVME16x_CONFIG_SPEED_32 ?32 :25 ); +pr_info (" VMEchip2 %spresent\n" , + rev & MVME16x_CONFIG_NO_VMECHIP2 ?"NOT " :"" ); +pr_info (" SCSI interface %spresent\n" , + rev & MVME16x_CONFIG_NO_SCSICHIP ?"NOT " :"" ); +pr_info (" Ethernet interface %spresent\n" , + rev & MVME16x_CONFIG_NO_ETHERNET ?"NOT " :"" ); }else {
arch/m68k/mvme16x/rtc.c +1 -1
@@ -158,7 +158,7 @@ static int __init rtc_MK48T08_init(void)if (!MACH_IS_MVME16x)return -ENODEV ; -printk (KERN_INFO "MK48T08 Real Time Clock Driver v%s\n" ,RTC_VERSION ); +pr_info ("MK48T08 Real Time Clock Driver v%s\n" ,RTC_VERSION );return misc_register (&rtc_dev); }device_initcall (rtc_MK48T08_init);
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 13/22 m68k/mvme16x: Modernize printing of kernel messages
In reply to Geert UytterhoevenConvert from printk() to pr_*().
--- arch/m68k/mvme16x/config.c | 32 ++++++++++++++++---------------- arch/m68k/mvme16x/rtc.c | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-)
arch/m68k/mvme16x/config.c +16 -16
@@ -72,8 +72,8 @@ int __init mvme16x_parse_bootinfo(const struct bi_record *bi)void mvme16x_reset (void ) { -printk ("\r\n\nCalled mvme16x_reset\r\n" -"\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r" ); +pr_info ("\r\n\nCalled mvme16x_reset\r\n" +"\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r" );/* The string of returns is to delay the reset until the whole * message is output. Assert reset bit in GCSR */ *(volatile char *)0xfff40107 =0x80 ;
@@ -289,7 +289,7 @@ void __init config_mvme16x(void)if (strncmp ("BDID" , p->bdid,4 )) { -printk ("\n\nBug call .BRD_ID returned garbage - giving up\n\n" ); +pr_crit ("Bug call .BRD_ID returned garbage - giving up\n" );while (1 ) ; }
@@ -298,25 +298,25 @@ void __init config_mvme16x(void) vme_brdtype = brdno;mvme16x_get_model (id); -printk ("\nBRD_ID: %s BUG %x.%x %02x/%02x/%02x\n" , id, p->rev>>4 , - p->rev&0xf , p->yr, p->mth, p->day); +pr_info ("BRD_ID: %s BUG %x.%x %02x/%02x/%02x\n" , id, p->rev >>4 , + p->rev &0xf , p->yr, p->mth, p->day);if (brdno ==0x0162 || brdno ==0x172 ) {unsigned char rev = *(unsigned char *)MVME162_VERSION_REG ; mvme16x_config = rev | MVME16x_CONFIG_GOT_SCCA; -printk ("MVME%x Hardware status:\n" , brdno); -printk (" CPU Type 68%s040\n" , - rev & MVME16x_CONFIG_GOT_FPU ?"" :"LC" ); -printk (" CPU clock %dMHz\n" , - rev & MVME16x_CONFIG_SPEED_32 ?32 :25 ); -printk (" VMEchip2 %spresent\n" , - rev & MVME16x_CONFIG_NO_VMECHIP2 ?"NOT " :"" ); -printk (" SCSI interface %spresent\n" , - rev & MVME16x_CONFIG_NO_SCSICHIP ?"NOT " :"" ); -printk (" Ethernet interface %spresent\n" , - rev & MVME16x_CONFIG_NO_ETHERNET ?"NOT " :"" ); +pr_info ("MVME%x Hardware status:\n" , brdno); +pr_info (" CPU Type 68%s040\n" , + rev & MVME16x_CONFIG_GOT_FPU ?"" :"LC" ); +pr_info (" CPU clock %dMHz\n" , + rev & MVME16x_CONFIG_SPEED_32 ?32 :25 ); +pr_info (" VMEchip2 %spresent\n" , + rev & MVME16x_CONFIG_NO_VMECHIP2 ?"NOT " :"" ); +pr_info (" SCSI interface %spresent\n" , + rev & MVME16x_CONFIG_NO_SCSICHIP ?"NOT " :"" ); +pr_info (" Ethernet interface %spresent\n" , + rev & MVME16x_CONFIG_NO_ETHERNET ?"NOT " :"" ); }else {
arch/m68k/mvme16x/rtc.c +1 -1
@@ -158,7 +158,7 @@ static int __init rtc_MK48T08_init(void)if (!MACH_IS_MVME16x)return -ENODEV ; -printk (KERN_INFO "MK48T08 Real Time Clock Driver v%s\n" ,RTC_VERSION ); +pr_info ("MK48T08 Real Time Clock Driver v%s\n" ,RTC_VERSION );return misc_register (&rtc_dev); }device_initcall (rtc_MK48T08_init);
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 14/22 m68k/q40: Modernize printing of kernel messages
In reply to Geert Uytterhoeven - Convert from printk() to pr_*(),
- Use TABs for indentation while at it.
--- arch/m68k/q40/config.c | 14 +++++++------- arch/m68k/q40/q40ints.c | 15 +++++++++------ 2 files changed, 16 insertions(+), 13 deletions(-)
arch/m68k/q40/config.c +7 -7
@@ -84,7 +84,7 @@ static int __init q40_debug_setup(char *arg) {/* useful for early debugging stages - writes kernel messages into SRAM */ if (MACH_IS_Q40 && !strncmp (arg,"mem" ,3 )) { -/*printk("using NVRAM debug, q40_mem_cptr=%p\n",q40_mem_cptr);*/ +/*pr_info("using NVRAM debug, q40_mem_cptr=%p\n",q40_mem_cptr);*/ _cpleft =2000 - ((long )q40_mem_cptr-0xff020000 ) /4 ;register_console (&q40_console_driver); }
@@ -124,8 +124,8 @@ static void q40_heartbeat(int on)static void q40_reset (void ) { - halted =1 ; -printk ("\n\n*******************************************\n" + halted =1 ; +pr_info ("*******************************************\n" "Called q40_reset : press the RESET button!!\n" "*******************************************\n" );Q40_LED_ON ();
@@ -135,10 +135,10 @@ static void q40_reset(void)static void q40_halt (void ) { - halted =1 ; -printk ("\n\n*******************\n" -" Called q40_halt\n" -"*******************\n" ); + halted =1 ; +pr_info ("*******************\n" +" Called q40_halt\n" +"*******************\n" );Q40_LED_ON ();while (1 ) ;
arch/m68k/q40/q40ints.c +9 -6
@@ -48,7 +48,8 @@ static unsigned int q40_irq_startup(struct irq_data *data)switch (irq) {case 1 :case 2 :case 8 :case 9 :case 11 :case 12 :case 13 : -printk ("%s: ISA IRQ %d not implemented by HW\n" , __func__, irq); +pr_warn ("%s: ISA IRQ %d not implemented by HW\n" , __func__, + irq);/* FIXME return -ENXIO; */ }return 0 ;
@@ -250,7 +251,7 @@ static void q40_irq_handler(unsigned int irq, struct pt_regs *fp)disable_irq (irq); disabled =1 ;#else -/*printk("IRQ_INPROGRESS detected for irq %d, disabling - %s disabled\n", +/*pr_warn("IRQ_INPROGRESS detected for irq %d, disabling - %s disabled\n", irq, disabled ? "already" : "not yet"); */ fp->sr = (((fp->sr) & (~0x700 ))+0x200 ); disabled =1 ;
@@ -273,7 +274,7 @@ static void q40_irq_handler(unsigned int irq, struct pt_regs *fp) }#else disabled =0 ; -/*printk("reenabling irq %d\n", irq); */ +/*pr_info("reenabling irq %d\n", irq); */ #endif }// used to do 'goto repeat;' here, this delayed bh processing too long
@@ -281,7 +282,8 @@ static void q40_irq_handler(unsigned int irq, struct pt_regs *fp) } }if (mer && ccleirq >0 && !aliased_irq) { -printk ("ISA interrupt from unknown source? EIRQ_REG = %x\n" ,mer); +pr_warn ("ISA interrupt from unknown source? EIRQ_REG = %x\n" , + mer); ccleirq--; } }
@@ -301,7 +303,7 @@ void q40_irq_enable(struct irq_data *data)if (irq >=5 && irq <=15 ) { mext_disabled--;if (mext_disabled >0 ) -printk ("q40_irq_enable : nested disable/enable\n" ); +pr_warn ("q40_irq_enable : nested disable/enable\n" );if (mext_disabled ==0 )master_outb (1 ,EXT_ENABLE_REG ); }
@@ -321,6 +323,7 @@ void q40_irq_disable(struct irq_data *data)master_outb (0 ,EXT_ENABLE_REG ); mext_disabled++;if (mext_disabled >1 ) -printk ("disable_irq nesting count %d\n" ,mext_disabled); +pr_info ("disable_irq nesting count %d\n" , + mext_disabled); } }
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 15/22 m68k/sun3: Modernize printing of kernel messages
In reply to Geert Uytterhoeven - Convert from printk() to pr_*(),
- Add missing continuations,
- Do not print nonexistent len variable,
- Add missing sysname[] variable,
- Correct printf()-style format specifiers.
--- arch/m68k/sun3/config.c | 2 +- arch/m68k/sun3/dvma.c | 3 +-- arch/m68k/sun3/idprom.c | 8 ++++--- arch/m68k/sun3/mmu_emu.c | 47 ++++++++++++++++++++-------------------- arch/m68k/sun3/prom/printf.c | 2 +- arch/m68k/sun3/sun3dvma.c | 51 +++++++++++++++++++------------------------- 6 files changed, 54 insertions(+), 59 deletions(-)
arch/m68k/sun3/config.c +1 -1
@@ -134,7 +134,7 @@ void __init config_sun3(void) {unsigned long memory_start, memory_end; -printk ("ARCH: SUN3\n" ); +pr_info ("ARCH: SUN3\n" );idprom_init ();/* Subtract kernel memory from available memory */
arch/m68k/sun3/dvma.c +1 -2
@@ -31,8 +31,7 @@ static unsigned long dvma_page(unsigned long kaddr, unsigned long vaddr) ptep =pfn_pte (virt_to_pfn (kaddr),PAGE_KERNEL ); pte =pte_val (ptep); -// printk("dvma_remap: addr %lx -> %lx pte %08lx len %x\n", -// kaddr, vaddr, pte, len); +// pr_info("dvma_remap: addr %lx -> %lx pte %08lx\n", kaddr, vaddr, pte); if (ptelist[(vaddr &0xff000 ) >>PAGE_SHIFT ] != pte) {sun3_put_pte (vaddr, pte); ptelist[(vaddr &0xff000 ) >>PAGE_SHIFT ] = pte;
arch/m68k/sun3/idprom.c +5 -3
@@ -64,12 +64,14 @@ static void __init display_system_type(unsigned char machtype)for (i =0 ; i <NUM_SUN_MACHINES ; i++) {if (Sun_Machines[i].id_machtype == machtype) {if (machtype != (SM_SUN4M_OBP |0x00 )) -printk ("TYPE: %s\n" , Sun_Machines[i].name); +pr_info ("TYPE: %s\n" , Sun_Machines[i].name);else {#if 0 +char sysname[128 ]; +prom_getproperty (prom_root_node,"banner-name" , sysname,sizeof (sysname)); -printk ("TYPE: %s\n" , sysname); +pr_info ("TYPE: %s\n" , sysname);#endif }return ;
@@ -125,5 +127,5 @@ void __init idprom_init(void)display_system_type (idprom->id_machtype); -printk ("Ethernet address: %pM\n" , idprom->id_ethaddr); +pr_info ("Ethernet address: %pM\n" , idprom->id_ethaddr); }
arch/m68k/sun3/mmu_emu.c +24 -23
111 lines not on this page · raw message
arch/m68k/sun3/prom/printf.c +1 -1
@@ -39,7 +39,7 @@#ifdef CONFIG_KGDB if (kgdb_initialized) { -printk ("kgdb_initialized = %d\n" , kgdb_initialized); +pr_info ("kgdb_initialized = %d\n" , kgdb_initialized);putpacket (bptr,1 ); } else#else
arch/m68k/sun3/sun3dvma.c +22 -29
130 lines not on this page · raw message
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 16/22 m68k/sun3x: Modernize printing of kernel messages
In reply to Geert Uytterhoeven - Convert from printk() to pr_*(),
- Remove #undef DEBUG,
- Drop useless Warning prefix,
- Use TABs for indentation while at it.
--- arch/m68k/include/asm/sun3xflop.h | 14 +++++++------- arch/m68k/sun3x/dvma.c | 35 +++++++++++++---------------------- arch/m68k/sun3x/prom.c | 4 ++-- 3 files changed, 22 insertions(+), 31 deletions(-)
arch/m68k/include/asm/sun3xflop.h +7 -7
@@ -48,7 +48,7 @@ static unsigned char sun3x_82072_fd_inb(int port)// udelay(5); switch (port &7 ) {default : -printk ("floppy: Asked to read unknown port %d\n" , port); +pr_crit ("floppy: Asked to read unknown port %d\n" , port);panic ("floppy: Port bolixed." );case 4 :/* FD_STATUS */ return (*sun3x_fdc.status_r) & ~STATUS_DMA ;
@@ -70,7 +70,7 @@ static void sun3x_82072_fd_outb(unsigned char value, int port)// udelay(5); switch (port &7 ) {default : -printk ("floppy: Asked to write to unknown port %d\n" , port); +pr_crit ("floppy: Asked to write to unknown port %d\n" , port);panic ("floppy: Port bolixed." );case 2 :/* FD_DOR */ /* Oh geese, 82072 on the Sun has no DOR register,
@@ -127,7 +127,7 @@ asmlinkage irqreturn_t sun3xflop_hardint(int irq, void *dev_id)return IRQ_HANDLED ; } -// printk("doing pdma\n");// st %x\n", sun_fdc->status_82072); +// pr_info("doing pdma\n");// st %x\n", sun_fdc->status_82072); #ifdef TRACE_FLPY_INT if (!calls)
@@ -171,7 +171,7 @@ asmlinkage irqreturn_t sun3xflop_hardint(int irq, void *dev_id)#ifdef TRACE_FLPY_INT calls++;#endif -// printk("st=%02x\n", st); +// pr_info("st=%02x\n", st); if (st ==0x20 )return IRQ_HANDLED ;if (!(st &0x20 )) {
@@ -180,9 +180,9 @@ asmlinkage irqreturn_t sun3xflop_hardint(int irq, void *dev_id) doing_pdma =0 ;#ifdef TRACE_FLPY_INT -printk ("count=%x, residue=%x calls=%d bytes=%x dma_wait=%d\n" , - virtual_dma_count, virtual_dma_residue, calls, bytes, - dma_wait); +pr_info ("count=%x, residue=%x calls=%d bytes=%x dma_wait=%d\n" , + virtual_dma_count, virtual_dma_residue, calls, bytes, + dma_wait); calls =0 ; dma_wait=0 ;#endif
arch/m68k/sun3x/dvma.c +13 -22
@@ -58,21 +58,17 @@ ((addr & 0x03c00000) >> \ (DVMA_PAGE_SHIFT+4))) -#undef DEBUG -#ifdef DEBUG /* code to print out a dvma mapping for debugging purposes */ void dvma_print (unsigned long dvma_addr) { -unsigned long index; - - index = dvma_addr >>DVMA_PAGE_SHIFT ; - -printk ("idx %lx dvma_addr %08lx paddr %08lx\n" , index, dvma_addr, -dvma_entry_paddr (index)); +unsigned long index; + index = dvma_addr >>DVMA_PAGE_SHIFT ; +pr_info ("idx %lx dvma_addr %08lx paddr %08lx\n" , index, dvma_addr, +dvma_entry_paddr (index)); }#endif
@@ -91,10 +87,7 @@ inline int dvma_map_cpu(unsigned long kaddr, end =PAGE_ALIGN (vaddr + len); -#ifdef DEBUG -printk ("dvma: mapping kern %08lx to virt %08lx\n" , - kaddr, vaddr); -#endif +pr_debug ("dvma: mapping kern %08lx to virt %08lx\n" , kaddr, vaddr); pgd =pgd_offset_k (vaddr); do {
@@ -126,10 +119,8 @@ inline int dvma_map_cpu(unsigned long kaddr, end3 = end2; do { -#ifdef DEBUG - printk("mapping %08lx phys to %08lx\n", - __pa(kaddr), vaddr); -#endif + pr_debug("mapping %08lx phys to %08lx\n", + __pa(kaddr), vaddr); set_pte(pte, pfn_pte(virt_to_pfn(kaddr), PAGE_KERNEL)); pte++;
@@ -162,7 +153,8 @@ inline int dvma_map_iommu(unsigned long kaddr, unsigned long baddr,for (; index < end ; index++) {// if(dvma_entry_use(index)) // BUG(); -// printk("mapping pa %lx to ba %lx\n", __pa(kaddr), index << DVMA_PAGE_SHIFT); +// pr_info("mapping pa %lx to ba %lx\n", __pa(kaddr), +// index << DVMA_PAGE_SHIFT); dvma_entry_set (index,__pa (kaddr));
@@ -190,13 +182,12 @@ void dvma_unmap_iommu(unsigned long baddr, int len) end = (DVMA_PAGE_ALIGN (baddr+len) >>DVMA_PAGE_SHIFT );for (; index < end ; index++) { -#ifdef DEBUG -printk ("freeing bus mapping %08x\n" , index <<DVMA_PAGE_SHIFT ); -#endif +pr_debug ("freeing bus mapping %08x\n" , + index <<DVMA_PAGE_SHIFT );#if 0 if (!dvma_entry_use (index)) -printk ("dvma_unmap freeing unused entry %04x\n" , - index); +pr_info ("dvma_unmap freeing unused entry %04x\n" , + index);else dvma_entry_dec (index);#endif
arch/m68k/sun3x/prom.c +2 -2
@@ -106,9 +106,9 @@ void __init sun3x_prom_init(void)idprom_init ();if (!((idprom->id_machtype &SM_ARCH_MASK ) ==SM_SUN3X )) { -printk ("Warning: machine reports strange type %02x\n" , +pr_warn ("Machine reports strange type %02x\n" , idprom->id_machtype); -printk ("Pretending it's a 3/80, but very afraid...\n" ); +pr_warn ("Pretending it's a 3/80, but very afraid...\n" ); idprom->id_machtype =SM_SUN3X |SM_3_80 ; }
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 16/22 m68k/sun3x: Modernize printing of kernel messages
In reply to Geert Uytterhoeven - Convert from printk() to pr_*(),
- Remove #undef DEBUG,
- Drop useless Warning prefix,
- Use TABs for indentation while at it.
--- arch/m68k/include/asm/sun3xflop.h | 14 +++++++------- arch/m68k/sun3x/dvma.c | 35 +++++++++++++---------------------- arch/m68k/sun3x/prom.c | 4 ++-- 3 files changed, 22 insertions(+), 31 deletions(-)
arch/m68k/include/asm/sun3xflop.h +7 -7
@@ -48,7 +48,7 @@ static unsigned char sun3x_82072_fd_inb(int port)// udelay(5); switch (port &7 ) {default : -printk ("floppy: Asked to read unknown port %d\n" , port); +pr_crit ("floppy: Asked to read unknown port %d\n" , port);panic ("floppy: Port bolixed." );case 4 :/* FD_STATUS */ return (*sun3x_fdc.status_r) & ~STATUS_DMA ;
@@ -70,7 +70,7 @@ static void sun3x_82072_fd_outb(unsigned char value, int port)// udelay(5); switch (port &7 ) {default : -printk ("floppy: Asked to write to unknown port %d\n" , port); +pr_crit ("floppy: Asked to write to unknown port %d\n" , port);panic ("floppy: Port bolixed." );case 2 :/* FD_DOR */ /* Oh geese, 82072 on the Sun has no DOR register,
@@ -127,7 +127,7 @@ asmlinkage irqreturn_t sun3xflop_hardint(int irq, void *dev_id)return IRQ_HANDLED ; } -// printk("doing pdma\n");// st %x\n", sun_fdc->status_82072); +// pr_info("doing pdma\n");// st %x\n", sun_fdc->status_82072); #ifdef TRACE_FLPY_INT if (!calls)
@@ -171,7 +171,7 @@ asmlinkage irqreturn_t sun3xflop_hardint(int irq, void *dev_id)#ifdef TRACE_FLPY_INT calls++;#endif -// printk("st=%02x\n", st); +// pr_info("st=%02x\n", st); if (st ==0x20 )return IRQ_HANDLED ;if (!(st &0x20 )) {
@@ -180,9 +180,9 @@ asmlinkage irqreturn_t sun3xflop_hardint(int irq, void *dev_id) doing_pdma =0 ;#ifdef TRACE_FLPY_INT -printk ("count=%x, residue=%x calls=%d bytes=%x dma_wait=%d\n" , - virtual_dma_count, virtual_dma_residue, calls, bytes, - dma_wait); +pr_info ("count=%x, residue=%x calls=%d bytes=%x dma_wait=%d\n" , + virtual_dma_count, virtual_dma_residue, calls, bytes, + dma_wait); calls =0 ; dma_wait=0 ;#endif
arch/m68k/sun3x/dvma.c +13 -22
@@ -58,21 +58,17 @@ ((addr & 0x03c00000) >> \ (DVMA_PAGE_SHIFT+4))) -#undef DEBUG -#ifdef DEBUG /* code to print out a dvma mapping for debugging purposes */ void dvma_print (unsigned long dvma_addr) { -unsigned long index; - - index = dvma_addr >>DVMA_PAGE_SHIFT ; - -printk ("idx %lx dvma_addr %08lx paddr %08lx\n" , index, dvma_addr, -dvma_entry_paddr (index)); +unsigned long index; + index = dvma_addr >>DVMA_PAGE_SHIFT ; +pr_info ("idx %lx dvma_addr %08lx paddr %08lx\n" , index, dvma_addr, +dvma_entry_paddr (index)); }#endif
@@ -91,10 +87,7 @@ inline int dvma_map_cpu(unsigned long kaddr, end =PAGE_ALIGN (vaddr + len); -#ifdef DEBUG -printk ("dvma: mapping kern %08lx to virt %08lx\n" , - kaddr, vaddr); -#endif +pr_debug ("dvma: mapping kern %08lx to virt %08lx\n" , kaddr, vaddr); pgd =pgd_offset_k (vaddr); do {
@@ -126,10 +119,8 @@ inline int dvma_map_cpu(unsigned long kaddr, end3 = end2; do { -#ifdef DEBUG - printk("mapping %08lx phys to %08lx\n", - __pa(kaddr), vaddr); -#endif + pr_debug("mapping %08lx phys to %08lx\n", + __pa(kaddr), vaddr); set_pte(pte, pfn_pte(virt_to_pfn(kaddr), PAGE_KERNEL)); pte++;
@@ -162,7 +153,8 @@ inline int dvma_map_iommu(unsigned long kaddr, unsigned long baddr,for (; index < end ; index++) {// if(dvma_entry_use(index)) // BUG(); -// printk("mapping pa %lx to ba %lx\n", __pa(kaddr), index << DVMA_PAGE_SHIFT); +// pr_info("mapping pa %lx to ba %lx\n", __pa(kaddr), +// index << DVMA_PAGE_SHIFT); dvma_entry_set (index,__pa (kaddr));
@@ -190,13 +182,12 @@ void dvma_unmap_iommu(unsigned long baddr, int len) end = (DVMA_PAGE_ALIGN (baddr+len) >>DVMA_PAGE_SHIFT );for (; index < end ; index++) { -#ifdef DEBUG -printk ("freeing bus mapping %08x\n" , index <<DVMA_PAGE_SHIFT ); -#endif +pr_debug ("freeing bus mapping %08x\n" , + index <<DVMA_PAGE_SHIFT );#if 0 if (!dvma_entry_use (index)) -printk ("dvma_unmap freeing unused entry %04x\n" , - index); +pr_info ("dvma_unmap freeing unused entry %04x\n" , + index);else dvma_entry_dec (index);#endif
arch/m68k/sun3x/prom.c +2 -2
@@ -106,9 +106,9 @@ void __init sun3x_prom_init(void)idprom_init ();if (!((idprom->id_machtype &SM_ARCH_MASK ) ==SM_SUN3X )) { -printk ("Warning: machine reports strange type %02x\n" , +pr_warn ("Machine reports strange type %02x\n" , idprom->id_machtype); -printk ("Pretending it's a 3/80, but very afraid...\n" ); +pr_warn ("Pretending it's a 3/80, but very afraid...\n" ); idprom->id_machtype =SM_SUN3X |SM_3_80 ; }
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 17/22 m68k/kernel: Modernize printing of kernel messages
In reply to Geert Uytterhoeven - Use pr_err_ratelimited() instead of deprecated printk_ratelimit(),
- Add dummies for validating format strings when debugging is disabled,
- Convert from printk() to pr_*(),
- Correct printf()-style format specifiers.
--- arch/m68k/kernel/dma.c | 4 ++-- arch/m68k/kernel/module.c | 12 ++++++------ arch/m68k/kernel/process.c | 20 ++++++++++---------- arch/m68k/kernel/signal.c | 24 +++++++----------------- arch/m68k/kernel/uboot.c | 3 +-- 5 files changed, 26 insertions(+), 37 deletions(-)
arch/m68k/kernel/dma.c +2 -2
@@ -110,8 +110,8 @@ static void m68k_dma_sync_single_for_device(struct device *dev,cache_clear (handle, size);break ;default : -if (printk_ratelimit ()) -printk ("dma_sync_single_for_device: unsupported dir %u\n" , dir); +pr_err_ratelimited ("dma_sync_single_for_device: unsupported dir %u\n" , + dir);break ; } }
arch/m68k/kernel/module.c +6 -6
@@ -12,9 +12,9 @@#include <linux/kernel.h> #if 0 -#define DEBUGP printk +#define DEBUGP (fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)#else -#define DEBUGP(fmt...) +#define DEBUGP (fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)#endif #ifdef CONFIG_MODULES
@@ -51,8 +51,8 @@ int apply_relocate(Elf32_Shdr *sechdrs, *location += sym->st_value - (uint32_t )location;break ;default : -printk (KERN_ERR "module %s: Unknown relocation: %u\n" , - me->name,ELF32_R_TYPE (rel[i].r_info)); +pr_err ("module %s: Unknown relocation: %u\n" , me->name, +ELF32_R_TYPE (rel[i].r_info));return -ENOEXEC ; } }
@@ -91,8 +91,8 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, *location = rel[i].r_addend + sym->st_value - (uint32_t )location;break ;default : -printk (KERN_ERR "module %s: Unknown relocation: %u\n" , - me->name,ELF32_R_TYPE (rel[i].r_info)); +pr_err ("module %s: Unknown relocation: %u\n" , me->name, +ELF32_R_TYPE (rel[i].r_info));return -ENOEXEC ; } }
arch/m68k/kernel/process.c +10 -10
@@ -87,17 +87,17 @@ void machine_power_off(void)void show_regs (struct pt_regs * regs) { -printk ("\n" ); -printk ("Format %02x Vector: %04x PC: %08lx Status: %04x %s\n" , - regs->format, regs->vector, regs->pc, regs->sr,print_tainted ()); -printk ("ORIG_D0: %08lx D0: %08lx A2: %08lx A1: %08lx\n" , - regs->orig_d0, regs->d0, regs->a2, regs->a1); -printk ("A0: %08lx D5: %08lx D4: %08lx\n" , - regs->a0, regs->d5, regs->d4); -printk ("D3: %08lx D2: %08lx D1: %08lx\n" , - regs->d3, regs->d2, regs->d1); +pr_info ("Format %02x Vector: %04x PC: %08lx Status: %04x %s\n" , + regs->format, regs->vector, regs->pc, regs->sr, +print_tainted ()); +pr_info ("ORIG_D0: %08lx D0: %08lx A2: %08lx A1: %08lx\n" , + regs->orig_d0, regs->d0, regs->a2, regs->a1); +pr_info ("A0: %08lx D5: %08lx D4: %08lx\n" , regs->a0, regs->d5, + regs->d4); +pr_info ("D3: %08lx D2: %08lx D1: %08lx\n" , regs->d3, regs->d2, + regs->d1);if (!(regs->sr &PS_S )) -printk ("USP: %08lx\n" ,rdusp ()); +pr_info ("USP: %08lx\n" ,rdusp ()); }void flush_thread (void )
arch/m68k/kernel/signal.c +7 -17
@@ -598,9 +598,7 @@ static int mangle_kernel_stack(struct pt_regs *regs, int formatvec,/* * user process trying to return with weird frame format */ -#ifdef DEBUG -printk ("user process returning with weird frame format\n" ); -#endif +pr_debug ("user process returning with weird frame format\n" );return 1 ; }if (!fsize) {
@@ -846,10 +844,8 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,int err =0 , sig = ksig->sig;if (fsize <0 ) { -#ifdef DEBUG -printk ("setup_frame: Unknown frame format %#x\n" , - regs->format); -#endif +pr_debug ("setup_frame: Unknown frame format %#x\n" , + regs->format);return -EFAULT ; }
@@ -905,9 +901,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,if (regs->stkadj) {struct pt_regs *tregs = (struct pt_regs *)((ulong )regs + regs->stkadj); -#ifdef DEBUG -printk ("Performing stackadjust=%04x\n" , regs->stkadj); -#endif +pr_debug ("Performing stackadjust=%04lx\n" , regs->stkadj);/* This must be copied with decreasing addresses to handle overlaps. */ tregs->vector =0 ;
@@ -926,10 +920,8 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,int err =0 , sig = ksig->sig;if (fsize <0 ) { -#ifdef DEBUG -printk ("setup_frame: Unknown frame format %#x\n" , - regs->format); -#endif +pr_debug ("setup_frame: Unknown frame format %#x\n" , + regs->format);return -EFAULT ; }
@@ -993,9 +985,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,if (regs->stkadj) {struct pt_regs *tregs = (struct pt_regs *)((ulong )regs + regs->stkadj); -#ifdef DEBUG -printk ("Performing stackadjust=%04x\n" , regs->stkadj); -#endif +pr_debug ("Performing stackadjust=%04lx\n" , regs->stkadj);/* This must be copied with decreasing addresses to handle overlaps. */ tregs->vector =0 ;
arch/m68k/kernel/uboot.c +1 -2
@@ -83,8 +83,7 @@ static void __init parse_uboot_commandline(char *commandp, int size) initrd_start = uboot_initrd_start; initrd_end = uboot_initrd_end;ROOT_DEV = Root_RAM0; -printk (KERN_INFO "initrd at 0x%lx:0x%lx\n" , - initrd_start, initrd_end); + pr_info("initrd at 0x%lx:0x%lx\n", initrd_start, initrd_end); }#endif /* if defined(CONFIG_BLK_DEV_INITRD) */ }
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 17/22 m68k/kernel: Modernize printing of kernel messages
In reply to Geert Uytterhoeven - Use pr_err_ratelimited() instead of deprecated printk_ratelimit(),
- Add dummies for validating format strings when debugging is disabled,
- Convert from printk() to pr_*(),
- Correct printf()-style format specifiers.
--- arch/m68k/kernel/dma.c | 4 ++-- arch/m68k/kernel/module.c | 12 ++++++------ arch/m68k/kernel/process.c | 20 ++++++++++---------- arch/m68k/kernel/signal.c | 24 +++++++----------------- arch/m68k/kernel/uboot.c | 3 +-- 5 files changed, 26 insertions(+), 37 deletions(-)
arch/m68k/kernel/dma.c +2 -2
@@ -110,8 +110,8 @@ static void m68k_dma_sync_single_for_device(struct device *dev,cache_clear (handle, size);break ;default : -if (printk_ratelimit ()) -printk ("dma_sync_single_for_device: unsupported dir %u\n" , dir); +pr_err_ratelimited ("dma_sync_single_for_device: unsupported dir %u\n" , + dir);break ; } }
arch/m68k/kernel/module.c +6 -6
@@ -12,9 +12,9 @@#include <linux/kernel.h> #if 0 -#define DEBUGP printk +#define DEBUGP (fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)#else -#define DEBUGP(fmt...) +#define DEBUGP (fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)#endif #ifdef CONFIG_MODULES
@@ -51,8 +51,8 @@ int apply_relocate(Elf32_Shdr *sechdrs, *location += sym->st_value - (uint32_t )location;break ;default : -printk (KERN_ERR "module %s: Unknown relocation: %u\n" , - me->name,ELF32_R_TYPE (rel[i].r_info)); +pr_err ("module %s: Unknown relocation: %u\n" , me->name, +ELF32_R_TYPE (rel[i].r_info));return -ENOEXEC ; } }
@@ -91,8 +91,8 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, *location = rel[i].r_addend + sym->st_value - (uint32_t )location;break ;default : -printk (KERN_ERR "module %s: Unknown relocation: %u\n" , - me->name,ELF32_R_TYPE (rel[i].r_info)); +pr_err ("module %s: Unknown relocation: %u\n" , me->name, +ELF32_R_TYPE (rel[i].r_info));return -ENOEXEC ; } }
arch/m68k/kernel/process.c +10 -10
@@ -87,17 +87,17 @@ void machine_power_off(void)void show_regs (struct pt_regs * regs) { -printk ("\n" ); -printk ("Format %02x Vector: %04x PC: %08lx Status: %04x %s\n" , - regs->format, regs->vector, regs->pc, regs->sr,print_tainted ()); -printk ("ORIG_D0: %08lx D0: %08lx A2: %08lx A1: %08lx\n" , - regs->orig_d0, regs->d0, regs->a2, regs->a1); -printk ("A0: %08lx D5: %08lx D4: %08lx\n" , - regs->a0, regs->d5, regs->d4); -printk ("D3: %08lx D2: %08lx D1: %08lx\n" , - regs->d3, regs->d2, regs->d1); +pr_info ("Format %02x Vector: %04x PC: %08lx Status: %04x %s\n" , + regs->format, regs->vector, regs->pc, regs->sr, +print_tainted ()); +pr_info ("ORIG_D0: %08lx D0: %08lx A2: %08lx A1: %08lx\n" , + regs->orig_d0, regs->d0, regs->a2, regs->a1); +pr_info ("A0: %08lx D5: %08lx D4: %08lx\n" , regs->a0, regs->d5, + regs->d4); +pr_info ("D3: %08lx D2: %08lx D1: %08lx\n" , regs->d3, regs->d2, + regs->d1);if (!(regs->sr &PS_S )) -printk ("USP: %08lx\n" ,rdusp ()); +pr_info ("USP: %08lx\n" ,rdusp ()); }void flush_thread (void )
arch/m68k/kernel/signal.c +7 -17
@@ -598,9 +598,7 @@ static int mangle_kernel_stack(struct pt_regs *regs, int formatvec,/* * user process trying to return with weird frame format */ -#ifdef DEBUG -printk ("user process returning with weird frame format\n" ); -#endif +pr_debug ("user process returning with weird frame format\n" );return 1 ; }if (!fsize) {
@@ -846,10 +844,8 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,int err =0 , sig = ksig->sig;if (fsize <0 ) { -#ifdef DEBUG -printk ("setup_frame: Unknown frame format %#x\n" , - regs->format); -#endif +pr_debug ("setup_frame: Unknown frame format %#x\n" , + regs->format);return -EFAULT ; }
@@ -905,9 +901,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,if (regs->stkadj) {struct pt_regs *tregs = (struct pt_regs *)((ulong )regs + regs->stkadj); -#ifdef DEBUG -printk ("Performing stackadjust=%04x\n" , regs->stkadj); -#endif +pr_debug ("Performing stackadjust=%04lx\n" , regs->stkadj);/* This must be copied with decreasing addresses to handle overlaps. */ tregs->vector =0 ;
@@ -926,10 +920,8 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,int err =0 , sig = ksig->sig;if (fsize <0 ) { -#ifdef DEBUG -printk ("setup_frame: Unknown frame format %#x\n" , - regs->format); -#endif +pr_debug ("setup_frame: Unknown frame format %#x\n" , + regs->format);return -EFAULT ; }
@@ -993,9 +985,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,if (regs->stkadj) {struct pt_regs *tregs = (struct pt_regs *)((ulong )regs + regs->stkadj); -#ifdef DEBUG -printk ("Performing stackadjust=%04x\n" , regs->stkadj); -#endif +pr_debug ("Performing stackadjust=%04lx\n" , regs->stkadj);/* This must be copied with decreasing addresses to handle overlaps. */ tregs->vector =0 ;
arch/m68k/kernel/uboot.c +1 -2
@@ -83,8 +83,7 @@ static void __init parse_uboot_commandline(char *commandp, int size) initrd_start = uboot_initrd_start; initrd_end = uboot_initrd_end;ROOT_DEV = Root_RAM0; -printk (KERN_INFO "initrd at 0x%lx:0x%lx\n" , - initrd_start, initrd_end); + pr_info("initrd at 0x%lx:0x%lx\n", initrd_start, initrd_end); }#endif /* if defined(CONFIG_BLK_DEV_INITRD) */ }
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 18/22 m68k/mm: kmap - Modernize printing of kernel messages
In reply to Geert Uytterhoeven - Convert from printk() to pr_*(),
- Add missing continuations,
- Remove #undef DEBUG.
Note that "#ifdef DEBUG" is sometimes retained because pr_cont() is not optimized away when debugging is disabled.
--- arch/m68k/mm/kmap.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-)
arch/m68k/mm/kmap.c +12 -14
@@ -21,8 +21,6 @@#include <asm/pgalloc.h> #include <asm/io.h> -#undef DEBUG -#define PTRTREESIZE (256*1024)/*
@@ -125,9 +123,7 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla }#endif -#ifdef DEBUG -printk ("ioremap: 0x%lx,0x%lx(%d) - " , physaddr, size, cacheflag); -#endif +pr_debug ("ioremap: 0x%lx,0x%lx(%d) - " , physaddr, size, cacheflag);/* * Mappings have to be aligned */
@@ -145,7 +141,7 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla virtaddr = (unsigned long )area->addr; retaddr = virtaddr + offset;#ifdef DEBUG -printk ("0x%lx,0x%lx,0x%lx" , physaddr, virtaddr, retaddr); +pr_cont ("0x%lx,0x%lx,0x%lx" , physaddr, virtaddr, retaddr);#endif /*
@@ -187,12 +183,12 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cacheflawhile ((long )size >0 ) {#ifdef DEBUG if (!(virtaddr & (PTRTREESIZE -1 ))) -printk ("\npa=%#lx va=%#lx " , physaddr, virtaddr); +pr_info ("\npa=%#lx va=%#lx " , physaddr, virtaddr);#endif pgd_dir =pgd_offset_k (virtaddr); pmd_dir =pmd_alloc (&init_mm, pgd_dir, virtaddr);if (!pmd_dir) { -printk ("ioremap: no mem for pmd_dir\n" ); +pr_err ("ioremap: no mem for pmd_dir\n" );return NULL ; }
@@ -204,7 +200,7 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla }else { pte_dir =pte_alloc_kernel (pmd_dir, virtaddr);if (!pte_dir) { -printk ("ioremap: no mem for pte_dir\n" ); +pr_err ("ioremap: no mem for pte_dir\n" );return NULL ; }
@@ -215,7 +211,7 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla } }#ifdef DEBUG -printk ("\n" ); +pr_cont ("\n" );#endif flush_tlb_all ();
@@ -254,7 +250,7 @@ void __iounmap(void *addr, unsigned long size)while ((long )size >0 ) { pgd_dir =pgd_offset_k (virtaddr);if (pgd_bad (*pgd_dir)) { -printk ("iounmap: bad pgd(%08lx)\n" ,pgd_val (*pgd_dir)); +pr_err ("iounmap: bad pgd(%08lx)\n" ,pgd_val (*pgd_dir));pgd_clear (pgd_dir);return ; }
@@ -274,7 +270,7 @@ void __iounmap(void *addr, unsigned long size) }if (pmd_bad (*pmd_dir)) { -printk ("iounmap: bad pmd (%08lx)\n" ,pmd_val (*pmd_dir)); +pr_err ("iounmap: bad pmd (%08lx)\n" ,pmd_val (*pmd_dir));pmd_clear (pmd_dir);return ; }
@@ -332,7 +328,8 @@ void kernel_set_cachemode(void *addr, unsigned long size, int cmode)while ((long )size >0 ) { pgd_dir =pgd_offset_k (virtaddr);if (pgd_bad (*pgd_dir)) { -printk ("iocachemode: bad pgd(%08lx)\n" ,pgd_val (*pgd_dir)); +pr_err ("iocachemode: bad pgd(%08lx)\n" , +pgd_val (*pgd_dir));pgd_clear (pgd_dir);return ; }
@@ -351,7 +348,8 @@ void kernel_set_cachemode(void *addr, unsigned long size, int cmode) }if (pmd_bad (*pmd_dir)) { -printk ("iocachemode: bad pmd (%08lx)\n" ,pmd_val (*pmd_dir)); +pr_err ("iocachemode: bad pmd (%08lx)\n" , +pmd_val (*pmd_dir));pmd_clear (pmd_dir);return ; }
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 18/22 m68k/mm: kmap - Modernize printing of kernel messages
In reply to Geert Uytterhoeven - Convert from printk() to pr_*(),
- Add missing continuations,
- Remove #undef DEBUG.
Note that "#ifdef DEBUG" is sometimes retained because pr_cont() is not optimized away when debugging is disabled.
--- arch/m68k/mm/kmap.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-)
arch/m68k/mm/kmap.c +12 -14
@@ -21,8 +21,6 @@#include <asm/pgalloc.h> #include <asm/io.h> -#undef DEBUG -#define PTRTREESIZE (256*1024)/*
@@ -125,9 +123,7 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla }#endif -#ifdef DEBUG -printk ("ioremap: 0x%lx,0x%lx(%d) - " , physaddr, size, cacheflag); -#endif +pr_debug ("ioremap: 0x%lx,0x%lx(%d) - " , physaddr, size, cacheflag);/* * Mappings have to be aligned */
@@ -145,7 +141,7 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla virtaddr = (unsigned long )area->addr; retaddr = virtaddr + offset;#ifdef DEBUG -printk ("0x%lx,0x%lx,0x%lx" , physaddr, virtaddr, retaddr); +pr_cont ("0x%lx,0x%lx,0x%lx" , physaddr, virtaddr, retaddr);#endif /*
@@ -187,12 +183,12 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cacheflawhile ((long )size >0 ) {#ifdef DEBUG if (!(virtaddr & (PTRTREESIZE -1 ))) -printk ("\npa=%#lx va=%#lx " , physaddr, virtaddr); +pr_info ("\npa=%#lx va=%#lx " , physaddr, virtaddr);#endif pgd_dir =pgd_offset_k (virtaddr); pmd_dir =pmd_alloc (&init_mm, pgd_dir, virtaddr);if (!pmd_dir) { -printk ("ioremap: no mem for pmd_dir\n" ); +pr_err ("ioremap: no mem for pmd_dir\n" );return NULL ; }
@@ -204,7 +200,7 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla }else { pte_dir =pte_alloc_kernel (pmd_dir, virtaddr);if (!pte_dir) { -printk ("ioremap: no mem for pte_dir\n" ); +pr_err ("ioremap: no mem for pte_dir\n" );return NULL ; }
@@ -215,7 +211,7 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla } }#ifdef DEBUG -printk ("\n" ); +pr_cont ("\n" );#endif flush_tlb_all ();
@@ -254,7 +250,7 @@ void __iounmap(void *addr, unsigned long size)while ((long )size >0 ) { pgd_dir =pgd_offset_k (virtaddr);if (pgd_bad (*pgd_dir)) { -printk ("iounmap: bad pgd(%08lx)\n" ,pgd_val (*pgd_dir)); +pr_err ("iounmap: bad pgd(%08lx)\n" ,pgd_val (*pgd_dir));pgd_clear (pgd_dir);return ; }
@@ -274,7 +270,7 @@ void __iounmap(void *addr, unsigned long size) }if (pmd_bad (*pmd_dir)) { -printk ("iounmap: bad pmd (%08lx)\n" ,pmd_val (*pmd_dir)); +pr_err ("iounmap: bad pmd (%08lx)\n" ,pmd_val (*pmd_dir));pmd_clear (pmd_dir);return ; }
@@ -332,7 +328,8 @@ void kernel_set_cachemode(void *addr, unsigned long size, int cmode)while ((long )size >0 ) { pgd_dir =pgd_offset_k (virtaddr);if (pgd_bad (*pgd_dir)) { -printk ("iocachemode: bad pgd(%08lx)\n" ,pgd_val (*pgd_dir)); +pr_err ("iocachemode: bad pgd(%08lx)\n" , +pgd_val (*pgd_dir));pgd_clear (pgd_dir);return ; }
@@ -351,7 +348,8 @@ void kernel_set_cachemode(void *addr, unsigned long size, int cmode) }if (pmd_bad (*pmd_dir)) { -printk ("iocachemode: bad pmd (%08lx)\n" ,pmd_val (*pmd_dir)); +pr_err ("iocachemode: bad pmd (%08lx)\n" , +pmd_val (*pmd_dir));pmd_clear (pmd_dir);return ; }
Signature · 1 line
1.9.1
Re: [PATCH 18/22] m68k/mm: kmap - Modernize printing of kernel messages
Quoted 7 lines · Geert Uytterhoeven
- Convert from
printk()to pr_*(),
- Add missing continuations,
- Remove #undef DEBUG.Note that "#ifdef DEBUG" is sometimes retained because
pr_cont()is not optimized away when debugging is disabled.
I think that argues for using printk(KERN_DEBUG ...) and print(KERN_CONT ...) inside #ifdef DEBUG, which would need no explanation.
If instead you use a combination of pr_debug and pr_cont and #ifdef DEBUG, perhaps the explanation should be moved from the commit log to a comment in the code?
Quoted 110 lines
Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/mm/kmap.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-)arch/m68k/mm/kmap.c +12
-14@@ -21,8 +21,6 @@#include <asm/pgalloc.h> #include <asm/io.h> -#undef DEBUG -#define PTRTREESIZE (256*1024)/* @@ -125,9 +123,7 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla }#endif -#ifdef DEBUG -printk ("ioremap: 0x%lx,0x%lx(%d) - " , physaddr, size, cacheflag); -#endif +pr_debug ("ioremap: 0x%lx,0x%lx(%d) - " , physaddr, size, cacheflag);/* * Mappings have to be aligned */ @@ -145,7 +141,7 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla virtaddr = (unsigned long )area->addr; retaddr = virtaddr + offset;#ifdef DEBUG -printk ("0x%lx,0x%lx,0x%lx" , physaddr, virtaddr, retaddr); +pr_cont ("0x%lx,0x%lx,0x%lx" , physaddr, virtaddr, retaddr);#endif /* @@ -187,12 +183,12 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cacheflawhile ((long )size >0 ) {#ifdef DEBUG if (!(virtaddr & (PTRTREESIZE -1 ))) -printk ("\npa=%#lx va=%#lx " , physaddr, virtaddr); +pr_info ("\npa=%#lx va=%#lx " , physaddr, virtaddr);#endif pgd_dir =pgd_offset_k (virtaddr); pmd_dir =pmd_alloc (&init_mm, pgd_dir, virtaddr);if (!pmd_dir) { -printk ("ioremap: no mem for pmd_dir\n" ); +pr_err ("ioremap: no mem for pmd_dir\n" );return NULL ; }@@ -204,7 +200,7 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla }else { pte_dir =pte_alloc_kernel (pmd_dir, virtaddr);if (!pte_dir) { -printk ("ioremap: no mem for pte_dir\n" ); +pr_err ("ioremap: no mem for pte_dir\n" );return NULL ; }@@ -215,7 +211,7 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla } }#ifdef DEBUG -printk ("\n" ); +pr_cont ("\n" );#endif flush_tlb_all ();@@ -254,7 +250,7 @@ void __iounmap(void *addr, unsigned long size)while ((long )size >0 ) { pgd_dir =pgd_offset_k (virtaddr);if (pgd_bad (*pgd_dir)) { -printk ("iounmap: bad pgd(%08lx)\n" ,pgd_val (*pgd_dir)); +pr_err ("iounmap: bad pgd(%08lx)\n" ,pgd_val (*pgd_dir));pgd_clear (pgd_dir);return ; }@@ -274,7 +270,7 @@ void __iounmap(void *addr, unsigned long size) }if (pmd_bad (*pmd_dir)) { -printk ("iounmap: bad pmd (%08lx)\n" ,pmd_val (*pmd_dir)); +pr_err ("iounmap: bad pmd (%08lx)\n" ,pmd_val (*pmd_dir));pmd_clear (pmd_dir);return ; }@@ -332,7 +328,8 @@ void kernel_set_cachemode(void *addr, unsigned long size, int cmode)while ((long )size >0 ) { pgd_dir =pgd_offset_k (virtaddr);if (pgd_bad (*pgd_dir)) { -printk ("iocachemode: bad pgd(%08lx)\n" ,pgd_val (*pgd_dir)); +pr_err ("iocachemode: bad pgd(%08lx)\n" , +pgd_val (*pgd_dir));pgd_clear (pgd_dir);return ; }@@ -351,7 +348,8 @@ void kernel_set_cachemode(void *addr, unsigned long size, int cmode) }if (pmd_bad (*pmd_dir)) { -printk ("iocachemode: bad pmd (%08lx)\n" ,pmd_val (*pmd_dir)); +pr_err ("iocachemode: bad pmd (%08lx)\n" , +pmd_val (*pmd_dir));pmd_clear (pmd_dir);return ; }
Re: [PATCH 18/22] m68k/mm: kmap - Modernize printing of kernel messages
Quoted 11 lines · On Thu, 8 Dec 2016, I wrote:
Quoted 7 lines · Geert Uytterhoeven
- Convert from
printk()to pr_*(),
- Add missing continuations,
- Remove #undef DEBUG.Note that "#ifdef DEBUG" is sometimes retained because
pr_cont()is not optimized away when debugging is disabled.
Quoted 7 lines
I think that argues for using
printk(KERN_DEBUG ...)andprint(KERN_CONT ...)inside #ifdef DEBUG, which would need no explanation.If instead you use a combination of
pr_debugandpr_contand #ifdef DEBUG, perhaps the explanation should be moved from the commit log to a comment in the code?
Perhaps a better solution than these alternatives would be,
#if defined(DEBUG)
#define pr_debug_cont pr_cont
#else
#define pr_debug_cont no_printk
#endif
But this API is still surprising and ugly. It doesn't work with CONFIG_DYNAMIC_DEBUG but that's not so important.
IMO, a far better linux/printk.h would have provided us with these definitions:
#define pr_emerg(fmt, ...) \
printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
/* ... */
#define pr_debug(fmt, ...) \
printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
#define pr_cont(fmt, ...) \
printk(KERN_CONT fmt, ##__VA_ARGS__)#if defined(CONFIG_DYNAMIC_DEBUG)
#define pr_debug_cond(fmt, ...) \
dynamic_pr_debug(fmt, ##__VA_ARGS__)
#define pr_cont_cond(fmt, ...) \
dynamic_pr_cont(fmt, ##__VA_ARGS__)
#elif defined(DEBUG)
#define pr_debug_cond(fmt, ...) \
printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
#define pr_cont_cond(fmt, ...) \
no_printk(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__)
#else
#define pr_debug_cond(fmt, ...) \
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
#define pr_cont_cond(fmt, ...) \
no_printk(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__)#endif
Which have the virtues of symmetry and least surprise.
Re: [PATCH 18/22] m68k/mm: kmap - Modernize printing of kernel messages
In reply to Finn ThainQuoted 11 lines · On Thu, 8 Dec 2016, I wrote:
Quoted 7 lines · Geert Uytterhoeven
- Convert from
printk()to pr_*(),
- Add missing continuations,
- Remove #undef DEBUG.Note that "#ifdef DEBUG" is sometimes retained because
pr_cont()is not optimized away when debugging is disabled.
Quoted 7 lines
I think that argues for using
printk(KERN_DEBUG ...)andprint(KERN_CONT ...)inside #ifdef DEBUG, which would need no explanation.If instead you use a combination of
pr_debugandpr_contand #ifdef DEBUG, perhaps the explanation should be moved from the commit log to a comment in the code?
Perhaps a better solution than these alternatives would be,
#if defined(DEBUG)
#define pr_debug_cont pr_cont
#else
#define pr_debug_cont no_printk
#endif
But this API is still surprising and ugly. It doesn't work with CONFIG_DYNAMIC_DEBUG but that's not so important.
IMO, a far better linux/printk.h would have provided us with these definitions:
#define pr_emerg(fmt, ...) \
printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
/* ... */
#define pr_debug(fmt, ...) \
printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
#define pr_cont(fmt, ...) \
printk(KERN_CONT fmt, ##__VA_ARGS__)#if defined(CONFIG_DYNAMIC_DEBUG)
#define pr_debug_cond(fmt, ...) \
dynamic_pr_debug(fmt, ##__VA_ARGS__)
#define pr_cont_cond(fmt, ...) \
dynamic_pr_cont(fmt, ##__VA_ARGS__)
#elif defined(DEBUG)
#define pr_debug_cond(fmt, ...) \
printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
#define pr_cont_cond(fmt, ...) \
no_printk(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__)
#else
#define pr_debug_cond(fmt, ...) \
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
#define pr_cont_cond(fmt, ...) \
no_printk(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__)#endif
Which have the virtues of symmetry and least surprise.
Re: [PATCH 18/22] m68k/mm: kmap - Modernize printing of kernel messages
In reply to Geert UytterhoevenQuoted 7 lines · Geert Uytterhoeven
- Convert from
printk()to pr_*(),
- Add missing continuations,
- Remove #undef DEBUG.Note that "#ifdef DEBUG" is sometimes retained because
pr_cont()is not optimized away when debugging is disabled.
I think that argues for using printk(KERN_DEBUG ...) and print(KERN_CONT ...) inside #ifdef DEBUG, which would need no explanation.
If instead you use a combination of pr_debug and pr_cont and #ifdef DEBUG, perhaps the explanation should be moved from the commit log to a comment in the code?
Quoted 110 lines
Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/mm/kmap.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-)arch/m68k/mm/kmap.c +12
-14@@ -21,8 +21,6 @@#include <asm/pgalloc.h> #include <asm/io.h> -#undef DEBUG -#define PTRTREESIZE (256*1024)/* @@ -125,9 +123,7 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla }#endif -#ifdef DEBUG -printk ("ioremap: 0x%lx,0x%lx(%d) - " , physaddr, size, cacheflag); -#endif +pr_debug ("ioremap: 0x%lx,0x%lx(%d) - " , physaddr, size, cacheflag);/* * Mappings have to be aligned */ @@ -145,7 +141,7 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla virtaddr = (unsigned long )area->addr; retaddr = virtaddr + offset;#ifdef DEBUG -printk ("0x%lx,0x%lx,0x%lx" , physaddr, virtaddr, retaddr); +pr_cont ("0x%lx,0x%lx,0x%lx" , physaddr, virtaddr, retaddr);#endif /* @@ -187,12 +183,12 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cacheflawhile ((long )size >0 ) {#ifdef DEBUG if (!(virtaddr & (PTRTREESIZE -1 ))) -printk ("\npa=%#lx va=%#lx " , physaddr, virtaddr); +pr_info ("\npa=%#lx va=%#lx " , physaddr, virtaddr);#endif pgd_dir =pgd_offset_k (virtaddr); pmd_dir =pmd_alloc (&init_mm, pgd_dir, virtaddr);if (!pmd_dir) { -printk ("ioremap: no mem for pmd_dir\n" ); +pr_err ("ioremap: no mem for pmd_dir\n" );return NULL ; }@@ -204,7 +200,7 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla }else { pte_dir =pte_alloc_kernel (pmd_dir, virtaddr);if (!pte_dir) { -printk ("ioremap: no mem for pte_dir\n" ); +pr_err ("ioremap: no mem for pte_dir\n" );return NULL ; }@@ -215,7 +211,7 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla } }#ifdef DEBUG -printk ("\n" ); +pr_cont ("\n" );#endif flush_tlb_all ();@@ -254,7 +250,7 @@ void __iounmap(void *addr, unsigned long size)while ((long )size >0 ) { pgd_dir =pgd_offset_k (virtaddr);if (pgd_bad (*pgd_dir)) { -printk ("iounmap: bad pgd(%08lx)\n" ,pgd_val (*pgd_dir)); +pr_err ("iounmap: bad pgd(%08lx)\n" ,pgd_val (*pgd_dir));pgd_clear (pgd_dir);return ; }@@ -274,7 +270,7 @@ void __iounmap(void *addr, unsigned long size) }if (pmd_bad (*pmd_dir)) { -printk ("iounmap: bad pmd (%08lx)\n" ,pmd_val (*pmd_dir)); +pr_err ("iounmap: bad pmd (%08lx)\n" ,pmd_val (*pmd_dir));pmd_clear (pmd_dir);return ; }@@ -332,7 +328,8 @@ void kernel_set_cachemode(void *addr, unsigned long size, int cmode)while ((long )size >0 ) { pgd_dir =pgd_offset_k (virtaddr);if (pgd_bad (*pgd_dir)) { -printk ("iocachemode: bad pgd(%08lx)\n" ,pgd_val (*pgd_dir)); +pr_err ("iocachemode: bad pgd(%08lx)\n" , +pgd_val (*pgd_dir));pgd_clear (pgd_dir);return ; }@@ -351,7 +348,8 @@ void kernel_set_cachemode(void *addr, unsigned long size, int cmode) }if (pmd_bad (*pmd_dir)) { -printk ("iocachemode: bad pmd (%08lx)\n" ,pmd_val (*pmd_dir)); +pr_err ("iocachemode: bad pmd (%08lx)\n" , +pmd_val (*pmd_dir));pmd_clear (pmd_dir);return ; }
Geert Uytterhoeven
maintainerPATCH 19/22 m68k/mm: motorola - Modernize printing of kernel messages
In reply to Geert Uytterhoeven - Convert from printk() to pr_*(),
- Remove #undef DEBUG,
- Add missing continuations.
Note that "#ifdef DEBUG" is sometimes retained because pr_cont() is not optimized away when debugging is disabled.
--- arch/m68k/include/asm/motorola_pgtable.h | 6 +++--- arch/m68k/mm/motorola.c | 32 ++++++++++++-------------------- 2 files changed, 15 insertions(+), 23 deletions(-)
arch/m68k/include/asm/motorola_pgtable.h +3 -3
@@ -153,11 +153,11 @@ static inline void pgd_set(pgd_t *pgdp, pmd_t *pmdp)#define pgd_page (pgd) (mem_map + ((unsigned long)(__va(pgd_val(pgd)) - PAGE_OFFSET) >> PAGE_SHIFT))#define pte_ERROR (e) \ - printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e)) + pr_err("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))#define pmd_ERROR (e) \ - printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e)) + pr_err("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e))#define pgd_ERROR (e) \ - printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) + pr_err("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))/*
arch/m68k/mm/motorola.c +12 -20
@@ -32,8 +32,6 @@#endif #include <asm/sections.h> -#undef DEBUG -#ifndef mm_cachebits/* * Bits to add to page descriptors for "normal" caching mode.
@@ -86,9 +84,7 @@ static pmd_t * __init kernel_ptr_table(void) } last_pgtable = (pmd_t *)last; -#ifdef DEBUG -printk ("kernel_ptr_init: %p\n" , last_pgtable); -#endif +pr_debug ("kernel_ptr_init: %p\n" , last_pgtable); } last_pgtable +=PTRS_PER_PMD ;
@@ -124,7 +120,7 @@ static void __init map_node(int node)while (size >0 ) {#ifdef DEBUG if (!(virtaddr & (PTRTREESIZE -1 ))) -printk ("\npa=%#lx va=%#lx " , physaddr &PAGE_MASK , +pr_cont ("\npa=%#lx va=%#lx " , physaddr &PAGE_MASK , virtaddr);#endif pgd_dir =pgd_offset_k (virtaddr);
@@ -132,7 +128,7 @@ static void __init map_node(int node)if (!(virtaddr & (ROOTTREESIZE -1 )) && size >=ROOTTREESIZE ) {#ifdef DEBUG -printk ("[very early term]" ); +pr_cont ("[very early term]" );#endif pgd_val (*pgd_dir) = physaddr; size -=ROOTTREESIZE ;
@@ -144,7 +140,7 @@ static void __init map_node(int node)if (!pgd_present (*pgd_dir)) { pmd_dir =kernel_ptr_table ();#ifdef DEBUG -printk ("[new pointer %p]" , pmd_dir); +pr_cont ("[new pointer %p]" , pmd_dir);#endif pgd_set (pgd_dir, pmd_dir); }else
@@ -153,14 +149,14 @@ static void __init map_node(int node)if (CPU_IS_020_OR_030 ) {if (virtaddr) {#ifdef DEBUG -printk ("[early term]" ); +pr_cont ("[early term]" );#endif pmd_dir->pmd[(virtaddr/PTRTREESIZE ) &15 ] = physaddr; physaddr +=PTRTREESIZE ; }else {int i;#ifdef DEBUG -printk ("[zero map]" ); +pr_cont ("[zero map]" );#endif zero_pgtable =kernel_ptr_table (); pte_dir = (pte_t *)zero_pgtable;
@@ -176,7 +172,7 @@ static void __init map_node(int node) }else {if (!pmd_present (*pmd_dir)) {#ifdef DEBUG -printk ("[new table]" ); +pr_cont ("[new table]" );#endif pte_dir =kernel_page_table ();pmd_set (pmd_dir, pte_dir);
@@ -195,7 +191,7 @@ static void __init map_node(int node) }#ifdef DEBUG -printk ("\n" ); +pr_cont ("\n" );#endif }
@@ -210,9 +206,7 @@ void __init paging_init(void)unsigned long addr, size, end;int i; -#ifdef DEBUG -printk ("start of paging_init (%p, %lx)\n" , kernel_pg_dir, availmem); -#endif +pr_debug ("start of paging_init (%p, %lx)\n" , kernel_pg_dir, availmem);/* Fix the cache mode in the page descriptors for the 680[46]0. */ if (CPU_IS_040_OR_060 ) {
@@ -228,9 +222,9 @@ void __init paging_init(void) max_addr = min_addr + m68k_memory[0 ].size;for (i =1 ; i < m68k_num_memory;) {if (m68k_memory[i].addr < min_addr) { -printk ("Ignoring memory chunk at 0x%lx:0x%lx before the first chunk\n" , +pr_warn ("Ignoring memory chunk at 0x%lx:0x%lx before the first chunk\n" , m68k_memory[i].addr, m68k_memory[i].size); -printk ("Fix your bootloader or use a memfile to make use of this area!\n" ); +pr_warn ("Fix your bootloader or use a memfile to make use of this area!\n" ); m68k_num_memory--;memmove (m68k_memory + i, m68k_memory + i +1 , (m68k_num_memory - i) *sizeof (struct m68k_mem_info ));
@@ -294,9 +288,7 @@ void __init paging_init(void)*/ set_fs (KERNEL_DS ); -#ifdef DEBUG -printk ("before free_area_init\n" ); -#endif +pr_debug ("before free_area_init\n" );for (i =0 ; i < m68k_num_memory; i++) { zones_size[ZONE_DMA ] = m68k_memory[i].size >>PAGE_SHIFT ; free_area_init_node(i, zones_size,
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 19/22 m68k/mm: motorola - Modernize printing of kernel messages
In reply to Geert Uytterhoeven - Convert from printk() to pr_*(),
- Remove #undef DEBUG,
- Add missing continuations.
Note that "#ifdef DEBUG" is sometimes retained because pr_cont() is not optimized away when debugging is disabled.
--- arch/m68k/include/asm/motorola_pgtable.h | 6 +++--- arch/m68k/mm/motorola.c | 32 ++++++++++++-------------------- 2 files changed, 15 insertions(+), 23 deletions(-)
arch/m68k/include/asm/motorola_pgtable.h +3 -3
@@ -153,11 +153,11 @@ static inline void pgd_set(pgd_t *pgdp, pmd_t *pmdp)#define pgd_page (pgd) (mem_map + ((unsigned long)(__va(pgd_val(pgd)) - PAGE_OFFSET) >> PAGE_SHIFT))#define pte_ERROR (e) \ - printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e)) + pr_err("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))#define pmd_ERROR (e) \ - printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e)) + pr_err("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e))#define pgd_ERROR (e) \ - printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) + pr_err("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))/*
arch/m68k/mm/motorola.c +12 -20
@@ -32,8 +32,6 @@#endif #include <asm/sections.h> -#undef DEBUG -#ifndef mm_cachebits/* * Bits to add to page descriptors for "normal" caching mode.
@@ -86,9 +84,7 @@ static pmd_t * __init kernel_ptr_table(void) } last_pgtable = (pmd_t *)last; -#ifdef DEBUG -printk ("kernel_ptr_init: %p\n" , last_pgtable); -#endif +pr_debug ("kernel_ptr_init: %p\n" , last_pgtable); } last_pgtable +=PTRS_PER_PMD ;
@@ -124,7 +120,7 @@ static void __init map_node(int node)while (size >0 ) {#ifdef DEBUG if (!(virtaddr & (PTRTREESIZE -1 ))) -printk ("\npa=%#lx va=%#lx " , physaddr &PAGE_MASK , +pr_cont ("\npa=%#lx va=%#lx " , physaddr &PAGE_MASK , virtaddr);#endif pgd_dir =pgd_offset_k (virtaddr);
@@ -132,7 +128,7 @@ static void __init map_node(int node)if (!(virtaddr & (ROOTTREESIZE -1 )) && size >=ROOTTREESIZE ) {#ifdef DEBUG -printk ("[very early term]" ); +pr_cont ("[very early term]" );#endif pgd_val (*pgd_dir) = physaddr; size -=ROOTTREESIZE ;
@@ -144,7 +140,7 @@ static void __init map_node(int node)if (!pgd_present (*pgd_dir)) { pmd_dir =kernel_ptr_table ();#ifdef DEBUG -printk ("[new pointer %p]" , pmd_dir); +pr_cont ("[new pointer %p]" , pmd_dir);#endif pgd_set (pgd_dir, pmd_dir); }else
@@ -153,14 +149,14 @@ static void __init map_node(int node)if (CPU_IS_020_OR_030 ) {if (virtaddr) {#ifdef DEBUG -printk ("[early term]" ); +pr_cont ("[early term]" );#endif pmd_dir->pmd[(virtaddr/PTRTREESIZE ) &15 ] = physaddr; physaddr +=PTRTREESIZE ; }else {int i;#ifdef DEBUG -printk ("[zero map]" ); +pr_cont ("[zero map]" );#endif zero_pgtable =kernel_ptr_table (); pte_dir = (pte_t *)zero_pgtable;
@@ -176,7 +172,7 @@ static void __init map_node(int node) }else {if (!pmd_present (*pmd_dir)) {#ifdef DEBUG -printk ("[new table]" ); +pr_cont ("[new table]" );#endif pte_dir =kernel_page_table ();pmd_set (pmd_dir, pte_dir);
@@ -195,7 +191,7 @@ static void __init map_node(int node) }#ifdef DEBUG -printk ("\n" ); +pr_cont ("\n" );#endif }
@@ -210,9 +206,7 @@ void __init paging_init(void)unsigned long addr, size, end;int i; -#ifdef DEBUG -printk ("start of paging_init (%p, %lx)\n" , kernel_pg_dir, availmem); -#endif +pr_debug ("start of paging_init (%p, %lx)\n" , kernel_pg_dir, availmem);/* Fix the cache mode in the page descriptors for the 680[46]0. */ if (CPU_IS_040_OR_060 ) {
@@ -228,9 +222,9 @@ void __init paging_init(void) max_addr = min_addr + m68k_memory[0 ].size;for (i =1 ; i < m68k_num_memory;) {if (m68k_memory[i].addr < min_addr) { -printk ("Ignoring memory chunk at 0x%lx:0x%lx before the first chunk\n" , +pr_warn ("Ignoring memory chunk at 0x%lx:0x%lx before the first chunk\n" , m68k_memory[i].addr, m68k_memory[i].size); -printk ("Fix your bootloader or use a memfile to make use of this area!\n" ); +pr_warn ("Fix your bootloader or use a memfile to make use of this area!\n" ); m68k_num_memory--;memmove (m68k_memory + i, m68k_memory + i +1 , (m68k_num_memory - i) *sizeof (struct m68k_mem_info ));
@@ -294,9 +288,7 @@ void __init paging_init(void)*/ set_fs (KERNEL_DS ); -#ifdef DEBUG -printk ("before free_area_init\n" ); -#endif +pr_debug ("before free_area_init\n" );for (i =0 ; i < m68k_num_memory; i++) { zones_size[ZONE_DMA ] = m68k_memory[i].size >>PAGE_SHIFT ; free_area_init_node(i, zones_size,
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 20/22 m68k/mm: sun3 - Modernize printing of kernel messages
In reply to Geert Uytterhoeven - Convert from printk() to pr_*(),
- Add missing print to do_page_mapin(), as print_pte_vaddr() calls
pr_cont().
--- arch/m68k/include/asm/sun3_pgtable.h | 6 +++--- arch/m68k/mm/sun3kmap.c | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-)
arch/m68k/include/asm/sun3_pgtable.h +3 -3
@@ -151,11 +151,11 @@ static inline void pgd_clear (pgd_t *pgdp) {}#define pte_ERROR (e) \ - printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e)) + pr_err("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))#define pmd_ERROR (e) \ - printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e)) + pr_err("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e))#define pgd_ERROR (e) \ - printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) + pr_err("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))/*
arch/m68k/mm/sun3kmap.c +3 -2
@@ -40,6 +40,7 @@ static inline void do_page_mapin(unsigned long phys, unsigned long virt,sun3_put_pte (virt, pte);#ifdef SUN3_KMAP_DEBUG +pr_info ("mapin:" );print_pte_vaddr (virt);#endif
@@ -80,8 +81,8 @@ void __iomem *sun3_ioremap(unsigned long phys, unsigned long size,return NULL ;#ifdef SUN3_KMAP_DEBUG -printk ("ioremap: got virt %p size %lx(%lx)\n" , - area->addr, size, area->size); +pr_info ("ioremap: got virt %p size %lx(%lx)\n" , area->addr, size, + area->size);#endif pages = size /PAGE_SIZE ;
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 21/22 m68k/mm: Modernize printing of kernel messages
In reply to Geert UytterhoevenConvert from printk() to pr_*().
--- arch/m68k/mm/init.c | 2 +- arch/m68k/mm/memory.c | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-)
arch/m68k/mm/init.c +1 -1
@@ -66,7 +66,7 @@ void __init m68k_setup_node(int node) end = (unsigned long )phys_to_virt (info->addr + info->size -1 ) >>__virt_to_node_shift ();for (; i <= end; i++) {if (pg_data_table[i]) -printk ("overlap at %u for chunk %u\n" , i, node); +pr_warn ("overlap at %u for chunk %u\n" , i, node); pg_data_table[i] = pg_data_map + node; }#endif
arch/m68k/mm/memory.c +1 -3
@@ -47,9 +47,7 @@ void __init init_pointer_table(unsigned long ptable) }PD_MARKBITS (dp) &= ~mask; -#ifdef DEBUG -printk ("init_pointer_table: %lx, %x\n" , ptable,PD_MARKBITS (dp)); -#endif +pr_debug ("init_pointer_table: %lx, %x\n" , ptable,PD_MARKBITS (dp));/* unreserve the page so it's possible to free that page */ PD_PAGE (dp)->flags &= ~(1 << PG_reserved);
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 21/22 m68k/mm: Modernize printing of kernel messages
In reply to Geert UytterhoevenConvert from printk() to pr_*().
--- arch/m68k/mm/init.c | 2 +- arch/m68k/mm/memory.c | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-)
arch/m68k/mm/init.c +1 -1
@@ -66,7 +66,7 @@ void __init m68k_setup_node(int node) end = (unsigned long )phys_to_virt (info->addr + info->size -1 ) >>__virt_to_node_shift ();for (; i <= end; i++) {if (pg_data_table[i]) -printk ("overlap at %u for chunk %u\n" , i, node); +pr_warn ("overlap at %u for chunk %u\n" , i, node); pg_data_table[i] = pg_data_map + node; }#endif
arch/m68k/mm/memory.c +1 -3
@@ -47,9 +47,7 @@ void __init init_pointer_table(unsigned long ptable) }PD_MARKBITS (dp) &= ~mask; -#ifdef DEBUG -printk ("init_pointer_table: %lx, %x\n" , ptable,PD_MARKBITS (dp)); -#endif +pr_debug ("init_pointer_table: %lx, %x\n" , ptable,PD_MARKBITS (dp));/* unreserve the page so it's possible to free that page */ PD_PAGE (dp)->flags &= ~(1 << PG_reserved);
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 22/22 m68k/include: Modernize printing of kernel messages
In reply to Geert Uytterhoeven - Convert from printk() to pr_*(),
- Add dummies for validating format strings when debugging is disabled.
--- arch/m68k/include/asm/bug.h | 4 ++-- arch/m68k/include/asm/floppy.h | 6 +++--- arch/m68k/include/asm/math-emu.h | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-)
arch/m68k/include/asm/bug.h +2 -2
@@ -6,12 +6,12 @@#ifdef CONFIG_DEBUG_BUGVERBOSE #ifndef CONFIG_SUN3 #define BUG () do { \ - printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ + pr_crit("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ __builtin_trap(); \ } while (0)#else #define BUG () do { \ - printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ + pr_crit("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ panic("BUG!"); \ } while (0)#endif
arch/m68k/include/asm/floppy.h +3 -3
@@ -234,9 +234,9 @@ asmlinkage irqreturn_t floppy_hardint(int irq, void *dev_id) virtual_dma_residue += virtual_dma_count; virtual_dma_count=0 ;#ifdef TRACE_FLPY_INT -printk ("count=%x, residue=%x calls=%d bytes=%d dma_wait=%d\n" , - virtual_dma_count, virtual_dma_residue, calls, bytes, - dma_wait); +pr_info ("count=%x, residue=%x calls=%d bytes=%d dma_wait=%d\n" , + virtual_dma_count, virtual_dma_residue, calls, bytes, + dma_wait); calls =0 ; dma_wait=0 ;#endif
arch/m68k/include/asm/math-emu.h +5 -5
@@ -105,21 +105,21 @@ struct fp_data {#ifdef FPU_EMU_DEBUG extern unsigned int fp_debugprint; -#define dprint(bit, fmt, args...) ({ \ +#define dprint (bit, fmt, ...) ({ \ if (fp_debugprint & (1 << (bit))) \ - printk(fmt, ## args); \ + pr_info(fmt, ##__VA_ARGS__); \ })#else -#define dprint(bit, fmt, args...) +#define dprint (bit, fmt, ...) no_printk(fmt, ##__VA_ARGS__)#endif #define uprint (str) ({ \ static int __count = 3; \ \ if (__count > 0) { \ - printk("You just hit an unimplemented " \ + pr_err("You just hit an unimplemented " \ "fpu instruction (%s)\n", str); \ - printk("Please report this to ....\n"); \ + pr_err("Please report this to ....\n"); \ __count--; \ } \ })
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerPATCH 22/22 m68k/include: Modernize printing of kernel messages
In reply to Geert Uytterhoeven - Convert from printk() to pr_*(),
- Add dummies for validating format strings when debugging is disabled.
--- arch/m68k/include/asm/bug.h | 4 ++-- arch/m68k/include/asm/floppy.h | 6 +++--- arch/m68k/include/asm/math-emu.h | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-)
arch/m68k/include/asm/bug.h +2 -2
@@ -6,12 +6,12 @@#ifdef CONFIG_DEBUG_BUGVERBOSE #ifndef CONFIG_SUN3 #define BUG () do { \ - printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ + pr_crit("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ __builtin_trap(); \ } while (0)#else #define BUG () do { \ - printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ + pr_crit("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ panic("BUG!"); \ } while (0)#endif
arch/m68k/include/asm/floppy.h +3 -3
@@ -234,9 +234,9 @@ asmlinkage irqreturn_t floppy_hardint(int irq, void *dev_id) virtual_dma_residue += virtual_dma_count; virtual_dma_count=0 ;#ifdef TRACE_FLPY_INT -printk ("count=%x, residue=%x calls=%d bytes=%d dma_wait=%d\n" , - virtual_dma_count, virtual_dma_residue, calls, bytes, - dma_wait); +pr_info ("count=%x, residue=%x calls=%d bytes=%d dma_wait=%d\n" , + virtual_dma_count, virtual_dma_residue, calls, bytes, + dma_wait); calls =0 ; dma_wait=0 ;#endif
arch/m68k/include/asm/math-emu.h +5 -5
@@ -105,21 +105,21 @@ struct fp_data {#ifdef FPU_EMU_DEBUG extern unsigned int fp_debugprint; -#define dprint(bit, fmt, args...) ({ \ +#define dprint (bit, fmt, ...) ({ \ if (fp_debugprint & (1 << (bit))) \ - printk(fmt, ## args); \ + pr_info(fmt, ##__VA_ARGS__); \ })#else -#define dprint(bit, fmt, args...) +#define dprint (bit, fmt, ...) no_printk(fmt, ##__VA_ARGS__)#endif #define uprint (str) ({ \ static int __count = 3; \ \ if (__count > 0) { \ - printk("You just hit an unimplemented " \ + pr_err("You just hit an unimplemented " \ "fpu instruction (%s)\n", str); \ - printk("Please report this to ....\n"); \ + pr_err("Please report this to ....\n"); \ __count--; \ } \ })
Signature · 1 line
1.9.1
Geert Uytterhoeven
maintainerQuoted 18 lines · Geert Uytterhoeven
This patch series modernizes the printing of kernel messages in the m68k architecture core, which is mainly about converting from
printk()to pr_*().The trigger for (finally) doing this was the user-visible breakage caused by commit
4bcc595ccd80decb("printk: reinstateKERN_CONTfor printing continuation lines").I had hoped to sent this series much earlier, to be still included in v4.9, but that didn't happen due to lack of time. Fortunately v4.9 will be an LTS(I) kernel, so the first three patches (tagged with a "Fixes" tag) will hopefully make it to v4.9.x later ;-)
Compile-tested with my standard set of configs.
Boot-tested on ARAnyM.Thanks for your comments!
Quoted 13 lines
Geert Uytterhoeven (22):
m68k/atari: Modernize printing of kernel messages m68k/68000: Modernize printing of kernel messages m68k/bvme6000: Modernize printing of kernel messages m68k/mvme147: Modernize printing of kernel messages m68k/mvme16x: Modernize printing of kernel messages m68k/q40: Modernize printing of kernel messages m68k/sun3: Modernize printing of kernel messages m68k/sun3x: Modernize printing of kernel messages m68k/kernel: Modernize printing of kernel messages m68k/mm: sun3 - Modernize printing of kernel messages m68k/mm: Modernize printing of kernel messages m68k/include: Modernize printing of kernel messages
I've applied and queued for v4.11 the subset above.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Geert Uytterhoeven
maintainerQuoted 18 lines · Geert Uytterhoeven
This patch series modernizes the printing of kernel messages in the m68k architecture core, which is mainly about converting from
printk()to pr_*().The trigger for (finally) doing this was the user-visible breakage caused by commit
4bcc595ccd80decb("printk: reinstateKERN_CONTfor printing continuation lines").I had hoped to sent this series much earlier, to be still included in v4.9, but that didn't happen due to lack of time. Fortunately v4.9 will be an LTS(I) kernel, so the first three patches (tagged with a "Fixes" tag) will hopefully make it to v4.9.x later ;-)
Compile-tested with my standard set of configs.
Boot-tested on ARAnyM.Thanks for your comments!
Quoted 13 lines
Geert Uytterhoeven (22):
m68k/atari: Modernize printing of kernel messages m68k/68000: Modernize printing of kernel messages m68k/bvme6000: Modernize printing of kernel messages m68k/mvme147: Modernize printing of kernel messages m68k/mvme16x: Modernize printing of kernel messages m68k/q40: Modernize printing of kernel messages m68k/sun3: Modernize printing of kernel messages m68k/sun3x: Modernize printing of kernel messages m68k/kernel: Modernize printing of kernel messages m68k/mm: sun3 - Modernize printing of kernel messages m68k/mm: Modernize printing of kernel messages m68k/include: Modernize printing of kernel messages
I've applied and queued for v4.11 the subset above.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Geert Uytterhoeven
maintainerQuoted 33 lines · Geert Uytterhoeven
Quoted 18 lines · Geert Uytterhoeven
This patch series modernizes the printing of kernel messages in the m68k architecture core, which is mainly about converting from
printk()to pr_*().The trigger for (finally) doing this was the user-visible breakage caused by commit
4bcc595ccd80decb("printk: reinstateKERN_CONTfor printing continuation lines").I had hoped to sent this series much earlier, to be still included in v4.9, but that didn't happen due to lack of time. Fortunately v4.9 will be an LTS(I) kernel, so the first three patches (tagged with a "Fixes" tag) will hopefully make it to v4.9.x later ;-)
Compile-tested with my standard set of configs.
Boot-tested on ARAnyM.Thanks for your comments!
Quoted 13 lines
Geert Uytterhoeven (22):
m68k/atari: Modernize printing of kernel messages m68k/68000: Modernize printing of kernel messages m68k/bvme6000: Modernize printing of kernel messages m68k/mvme147: Modernize printing of kernel messages m68k/mvme16x: Modernize printing of kernel messages m68k/q40: Modernize printing of kernel messages m68k/sun3: Modernize printing of kernel messages m68k/sun3x: Modernize printing of kernel messages m68k/kernel: Modernize printing of kernel messages m68k/mm: sun3 - Modernize printing of kernel messages m68k/mm: Modernize printing of kernel messages m68k/include: Modernize printing of kernel messages
Quoted 1 line
I've applied and queued for v4.11 the subset above.
This time for real...
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds