LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] printk: Use symbolic defines for console loglevels instead of numbers
@ 2015-03-16  9:01 Alexander Kuleshov
  2015-03-16  9:20 ` Geert Uytterhoeven
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Alexander Kuleshov @ 2015-03-16  9:01 UTC (permalink / raw)
  To: Tony Lindgren, Russell King, Paul Mackerras, Michael Ellerman,
	Gavin Shan, Geert Uytterhoeven
  Cc: linux-kernel, Alexander Kuleshov

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
 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(-)

diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 57dee0c..5fb50fe 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -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);
diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c
index 5c1a6b2..8996da9 100644
--- a/arch/m68k/mac/macints.c
+++ b/arch/m68k/mac/macints.c
@@ -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();
diff --git a/arch/m68k/mac/oss.c b/arch/m68k/mac/oss.c
index 5403712..f38fcbf 100644
--- a/arch/m68k/mac/oss.c
+++ b/arch/m68k/mac/oss.c
@@ -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
diff --git a/arch/powerpc/kernel/udbg.c b/arch/powerpc/kernel/udbg.c
index b7aa072..5525a85 100644
--- a/arch/powerpc/kernel/udbg.c
+++ b/arch/powerpc/kernel/udbg.c
@@ -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
-- 
2.3.3.472.g20ceeac.dirty


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

* Re: [PATCH] printk: Use symbolic defines for console loglevels instead of numbers
  2015-03-16  9:01 [PATCH] printk: Use symbolic defines for console loglevels instead of numbers Alexander Kuleshov
@ 2015-03-16  9:20 ` Geert Uytterhoeven
  2015-03-16 10:50   ` Alexander Kuleshov
  2015-03-16 10:44 ` Michael Ellerman
  2015-03-16 15:09 ` Joe Perches
  2 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2015-03-16  9:20 UTC (permalink / raw)
  To: Alexander Kuleshov
  Cc: Tony Lindgren, Russell King, Paul Mackerras, Michael Ellerman,
	Gavin Shan, linux-kernel

On Mon, Mar 16, 2015 at 10:01 AM, Alexander Kuleshov
<kuleshovmail@gmail.com> wrote:
> --- a/arch/m68k/mac/macints.c
> +++ b/arch/m68k/mac/macints.c
> @@ -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 -- geert@linux-m68k.org

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

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

* Re: [PATCH] printk: Use symbolic defines for console loglevels instead of numbers
  2015-03-16  9:01 [PATCH] printk: Use symbolic defines for console loglevels instead of numbers Alexander Kuleshov
  2015-03-16  9:20 ` Geert Uytterhoeven
@ 2015-03-16 10:44 ` Michael Ellerman
  2015-03-16 15:09 ` Joe Perches
  2 siblings, 0 replies; 7+ messages in thread
From: Michael Ellerman @ 2015-03-16 10:44 UTC (permalink / raw)
  To: Alexander Kuleshov
  Cc: Tony Lindgren, Russell King, Paul Mackerras, Gavin Shan,
	Geert Uytterhoeven, linux-kernel

On Mon, 2015-03-16 at 15:01 +0600, Alexander Kuleshov wrote:
> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
> ---
> diff --git a/arch/powerpc/kernel/udbg.c b/arch/powerpc/kernel/udbg.c
> index b7aa072..5525a85 100644
> --- a/arch/powerpc/kernel/udbg.c
> +++ b/arch/powerpc/kernel/udbg.c
> @@ -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

Acked-by: Michael Ellerman <mpe@ellerman.id.au>

cheers



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

* Re: [PATCH] printk: Use symbolic defines for console loglevels instead of numbers
  2015-03-16  9:20 ` Geert Uytterhoeven
@ 2015-03-16 10:50   ` Alexander Kuleshov
  2015-03-16 11:02     ` Geert Uytterhoeven
  0 siblings, 1 reply; 7+ messages in thread
From: Alexander Kuleshov @ 2015-03-16 10:50 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-kernel

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 <geert@linux-m68k.org>:
> On Mon, Mar 16, 2015 at 10:01 AM, Alexander Kuleshov
> <kuleshovmail@gmail.com> wrote:
>> --- a/arch/m68k/mac/macints.c
>> +++ b/arch/m68k/mac/macints.c
>> @@ -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) {"
>

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

* Re: [PATCH] printk: Use symbolic defines for console loglevels instead of numbers
  2015-03-16 10:50   ` Alexander Kuleshov
@ 2015-03-16 11:02     ` Geert Uytterhoeven
  0 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2015-03-16 11:02 UTC (permalink / raw)
  To: Alexander Kuleshov; +Cc: linux-kernel

Hi Alexander,

On Mon, Mar 16, 2015 at 11:50 AM, Alexander Kuleshov
<kuleshovmail@gmail.com> wrote:
> 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.

Thanks, that makes sense. Please add this valuable information to the patch
description, and you can add my

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

for the m68k part.

> 2015-03-16 15:20 GMT+06:00 Geert Uytterhoeven <geert@linux-m68k.org>:
>> On Mon, Mar 16, 2015 at 10:01 AM, Alexander Kuleshov
>> <kuleshovmail@gmail.com> wrote:
>>> --- a/arch/m68k/mac/macints.c
>>> +++ b/arch/m68k/mac/macints.c
>>> @@ -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 -- geert@linux-m68k.org

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

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

* Re: [PATCH] printk: Use symbolic defines for console loglevels instead of numbers
  2015-03-16  9:01 [PATCH] printk: Use symbolic defines for console loglevels instead of numbers Alexander Kuleshov
  2015-03-16  9:20 ` Geert Uytterhoeven
  2015-03-16 10:44 ` Michael Ellerman
@ 2015-03-16 15:09 ` Joe Perches
  2015-03-17 10:59   ` Alexander Kuleshov
  2 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2015-03-16 15:09 UTC (permalink / raw)
  To: Alexander Kuleshov
  Cc: Tony Lindgren, Russell King, Paul Mackerras, Michael Ellerman,
	Gavin Shan, Geert Uytterhoeven, linux-kernel

On Mon, 2015-03-16 at 15:01 +0600, Alexander Kuleshov wrote:
> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>

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.



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

* Re: [PATCH] printk: Use symbolic defines for console loglevels instead of numbers
  2015-03-16 15:09 ` Joe Perches
@ 2015-03-17 10:59   ` Alexander Kuleshov
  0 siblings, 0 replies; 7+ messages in thread
From: Alexander Kuleshov @ 2015-03-17 10:59 UTC (permalink / raw)
  To: Joe Perches
  Cc: Tony Lindgren, Russell King, Paul Mackerras, Michael Ellerman,
	Gavin Shan, Geert Uytterhoeven, LKML

2015-03-16 21:09 GMT+06:00 Joe Perches <joe@perches.com>:
> On Mon, 2015-03-16 at 15:01 +0600, Alexander Kuleshov wrote:
>> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
>
> 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.
>
>

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

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

end of thread, other threads:[~2015-03-17 10:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-16  9:01 [PATCH] printk: Use symbolic defines for console loglevels instead of numbers Alexander Kuleshov
2015-03-16  9:20 ` Geert Uytterhoeven
2015-03-16 10:50   ` Alexander Kuleshov
2015-03-16 11:02     ` Geert Uytterhoeven
2015-03-16 10:44 ` Michael Ellerman
2015-03-16 15:09 ` Joe Perches
2015-03-17 10:59   ` Alexander Kuleshov

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