printk: Use symbolic defines for console loglevels instead of numbers
Subsystems (6)
PATCH 1/1 printk: Use symbolic defines for console loglevels instead of numbers
--- arch/arm/mach-omap2/serial.c | 2 +- arch/m68k/mac/macints.c | 2 +- arch/m68k/mac/oss.c | 4 ++-- arch/powerpc/kernel/udbg.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/mach-omap2/serial.c +1 -1
@@ -203,7 +203,7 @@ static int __init omap_serial_early_init(void)if (cmdline_find_option (uart_name)) { console_uart_id = uart->num; -if (console_loglevel >=10 ) { +if (console_loglevel >=CONSOLE_LOGLEVEL_DEBUG ) { uart_debug = true;pr_info ("%s used as console in debug mode: uart%d clocks will not be gated" , uart_name, uart->num);
arch/m68k/mac/macints.c +1 -1
@@ -315,7 +315,7 @@ irqreturn_t mac_nmi_handler(int irq, void *dev_id)while (nmi_hold ==1 )udelay (1000 ); -if (console_loglevel >=8 ) { +if (console_loglevel >=CONSOLE_LOGLEVEL_DEBUG ) {#if 0 struct pt_regs *fp =get_irq_regs ();show_state ();
arch/m68k/mac/oss.c +2 -2
@@ -70,7 +70,7 @@ static void oss_irq(unsigned int irq, struct irq_desc *desc) (OSS_IP_IOPSCC |OSS_IP_SCSI |OSS_IP_IOPISM );#ifdef DEBUG_IRQS -if ((console_loglevel ==10 ) && !(events &OSS_IP_SCSI )) { +if ((console_loglevel ==CONSOLE_LOGLEVEL_DEBUG ) && !(events &OSS_IP_SCSI )) {printk ("oss_irq: irq %u events = 0x%04X\n" , irq, (int ) oss->irq_pending); }
@@ -107,7 +107,7 @@ static void oss_nubus_irq(unsigned int irq, struct irq_desc *desc)return ;#ifdef DEBUG_NUBUS_INT -if (console_loglevel >7 ) { +if (console_loglevel >CONSOLE_LOGLEVEL_DEFAULT ) {printk ("oss_nubus_irq: events = 0x%04X\n" , events); }#endif
arch/powerpc/kernel/udbg.c +1 -1
@@ -76,7 +76,7 @@ void __init udbg_early_init(void)#endif #ifdef CONFIG_PPC_EARLY_DEBUG - console_loglevel =10 ; + console_loglevel =CONSOLE_LOGLEVEL_DEBUG ;register_early_udbg_console ();#endif
Signature · 1 line
2.3.3.472.g20ceeac.dirty
Geert Uytterhoeven
maintainerarch/m68k/mac/macints.c irqreturn_t mac_nmi_handler(int irq, void *dev_id) · line 318
Quoted 8 lines · Alexander Kuleshov
arch/m68k/mac/macints.c +1
-1@@ -315,7 +315,7 @@ irqreturn_t mac_nmi_handler(int irq, void *dev_id)while (nmi_hold ==1 )udelay (1000 ); -if (console_loglevel >=8 ) { +if (console_loglevel >=CONSOLE_LOGLEVEL_DEBUG ) {
CONSOLE_LOGLEVEL_DEBUG == 10, not 8
As there's no define for 8, perhaps you can use:
"if (console_loglevel > CONSOLE_LOGLEVEL_DEFAULT) {"
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
Hello Geert,
Yes, i thougt about this issue. I looked in git history and found the commit - a8fe19ebfbfd90ec17c02284717238b02efb9580 where level 8 changed on 10,
so i decided to put CONSOLE_LOGLEVEL_DEBUG here.
2015-03-16 15:20 GMT+06:00 Geert Uytterhoeven <[email protected]>:
Quoted 17 lines
arch/m68k/mac/macints.c irqreturn_t mac_nmi_handler(int irq, void *dev_id) · line 318
Quoted 8 lines · Alexander Kuleshov
arch/m68k/mac/macints.c +1
-1@@ -315,7 +315,7 @@ irqreturn_t mac_nmi_handler(int irq, void *dev_id)while (nmi_hold ==1 )udelay (1000 ); -if (console_loglevel >=8 ) { +if (console_loglevel >=CONSOLE_LOGLEVEL_DEBUG ) {
CONSOLE_LOGLEVEL_DEBUG== 10, not 8As there's no define for 8, perhaps you can use:
"if (
console_loglevel>CONSOLE_LOGLEVEL_DEFAULT) {"
Hi Alexander,
Quoted 4 lines · Alexander Kuleshov
Yes, i thougt about this issue. I looked in git history and found the commit -
a8fe19ebfbfd90ec17c02284717238b02efb9580where level 8 changed on 10,
so i decided to putCONSOLE_LOGLEVEL_DEBUGhere.
Thanks, that makes sense. Please add this valuable information to the patch description, and you can add my
for the m68k part.
Quoted 17 lines
2015-03-16 15:20 GMT+06:00 Geert Uytterhoeven <[email protected]>:
Quoted 16 lines
arch/m68k/mac/macints.c irqreturn_t mac_nmi_handler(int irq, void *dev_id) · line 318
Quoted 8 lines · Alexander Kuleshov
arch/m68k/mac/macints.c +1
-1@@ -315,7 +315,7 @@ irqreturn_t mac_nmi_handler(int irq, void *dev_id)while (nmi_hold ==1 )udelay (1000 ); -if (console_loglevel >=8 ) { +if (console_loglevel >=CONSOLE_LOGLEVEL_DEBUG ) {
CONSOLE_LOGLEVEL_DEBUG== 10, not 8As there's no define for 8, perhaps you can use:
"if (
console_loglevel>CONSOLE_LOGLEVEL_DEFAULT) {"
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
Quoted 7 lines · Alexander Kuleshov
Signed-off-by Alexander Kuleshov <[email protected]>---
arch/powerpc/kernel/udbg.c +0
-0
arch/powerpc/kernel/udbg.c void __init udbg_early_init(void) · line 82
Quoted 8 lines
arch/powerpc/kernel/udbg.c +1
-1@@ -76,7 +76,7 @@ void __init udbg_early_init(void)#endif #ifdef CONFIG_PPC_EARLY_DEBUG - console_loglevel =10 ; + console_loglevel =CONSOLE_LOGLEVEL_DEBUG ;register_early_udbg_console ();#endif
cheers
Quoted 1 line · Alexander Kuleshov
Signed-off-by Alexander Kuleshov <[email protected]>
Perhaps the entries for #define CONSOLE_LOGLEVEL_<FOO> from printk.h and #define LOGLEVEL_<FOO> from kern_levels.h can be consolidated and rationalized as well.
2015-03-16 21:09 GMT+06:00 Joe Perches <[email protected]>:
Quoted 8 lines · Alexander Kuleshov
Quoted 1 line
Signed-off-by Alexander Kuleshov <[email protected]>Perhaps the entries for #define CONSOLE_LOGLEVEL_<FOO> from
printk.hand #define LOGLEVEL_<FOO> fromkern_levels.hcan be consolidated and rationalized as well.
Hello Joe,
yes good idea. What was the purpose of adding LOGLEVEL_<FOO> macro? I see that CONSOLE_LOGLEVEL_<FOO> were added earlier. what if we remove LOGLEVL_<FOO> macro and add/adapt missing as CONSOLE_LOGLEVEL_<FOO>, like CONSOLE_LOGLEVEL_SCHED and etc...?