diff mbox

[1/4] printk: rename DEFAULT_MESSAGE_LOGLEVEL

Message ID 1404911056-29064-2-git-send-email-elder@linaro.org
State New
Headers show

Commit Message

Alex Elder July 9, 2014, 1:04 p.m. UTC
This commit:
    a8fe19eb kernel/printk: use symbolic defines for console loglevels
makes consistent use of symbolic values for printk() log levels.

The naming scheme used is different from the one used for
DEFAULT_MESSAGE_LOGLEVEL though.  Change that symbol name to be
MESSAGE_LOGLEVEL_DEFAULT for consistency.

Note that we don't rename CONFIG_DEFAULT_MESSAGE_LOGLEVEL (to avoid
breaking existing config files that might reference it).

Signed-off-by: Alex Elder <elder@linaro.org>
---
 include/linux/printk.h | 2 +-
 kernel/printk/printk.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Borislav Petkov July 9, 2014, 3 p.m. UTC | #1
On Wed, Jul 09, 2014 at 08:04:13AM -0500, Alex Elder wrote:
> This commit:
>     a8fe19eb kernel/printk: use symbolic defines for console loglevels
> makes consistent use of symbolic values for printk() log levels.
> 
> The naming scheme used is different from the one used for
> DEFAULT_MESSAGE_LOGLEVEL though.  Change that symbol name to be
> MESSAGE_LOGLEVEL_DEFAULT for consistency.
> 
> Note that we don't rename CONFIG_DEFAULT_MESSAGE_LOGLEVEL (to avoid
> breaking existing config files that might reference it).
> 
> Signed-off-by: Alex Elder <elder@linaro.org>
> ---
>  include/linux/printk.h | 2 +-
>  kernel/printk/printk.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/printk.h b/include/linux/printk.h
> index 319ff7e..3d1ccad 100644
> --- a/include/linux/printk.h
> +++ b/include/linux/printk.h
> @@ -31,7 +31,7 @@ static inline const char *printk_skip_level(const char *buffer)
>  }
>  
>  /* printk's without a loglevel use this.. */
> -#define DEFAULT_MESSAGE_LOGLEVEL CONFIG_DEFAULT_MESSAGE_LOGLEVEL
> +#define MESSAGE_LOGLEVEL_DEFAULT CONFIG_DEFAULT_MESSAGE_LOGLEVEL

Well, I can't say I like it - we have the config item
CONFIG_DEFAULT_MESSAGE_LOGLEVEL and DEFAULT_MESSAGE_LOGLEVEL resembles
it for a reason - it is the corresponding define coming from .config.

With this change you have:

CONFIG_DEFAULT_MESSAGE_LOGLEVEL
       MESSAGE_LOGLEVEL_DEFAULT

which is more confusing. To me at least. I can't see the resemblance at
a quick glance anymore.
Alex Elder July 9, 2014, 3:10 p.m. UTC | #2
On 07/09/2014 10:00 AM, Borislav Petkov wrote:
> On Wed, Jul 09, 2014 at 08:04:13AM -0500, Alex Elder wrote:
>> This commit:
>>      a8fe19eb kernel/printk: use symbolic defines for console loglevels
>> makes consistent use of symbolic values for printk() log levels.
>>
>> The naming scheme used is different from the one used for
>> DEFAULT_MESSAGE_LOGLEVEL though.  Change that symbol name to be
>> MESSAGE_LOGLEVEL_DEFAULT for consistency.
>>
>> Note that we don't rename CONFIG_DEFAULT_MESSAGE_LOGLEVEL (to avoid
>> breaking existing config files that might reference it).
>>
>> Signed-off-by: Alex Elder <elder@linaro.org>
>> ---
>>   include/linux/printk.h | 2 +-
>>   kernel/printk/printk.c | 2 +-
>>   2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/linux/printk.h b/include/linux/printk.h
>> index 319ff7e..3d1ccad 100644
>> --- a/include/linux/printk.h
>> +++ b/include/linux/printk.h
>> @@ -31,7 +31,7 @@ static inline const char *printk_skip_level(const char *buffer)
>>   }
>>
>>   /* printk's without a loglevel use this.. */
>> -#define DEFAULT_MESSAGE_LOGLEVEL CONFIG_DEFAULT_MESSAGE_LOGLEVEL
>> +#define MESSAGE_LOGLEVEL_DEFAULT CONFIG_DEFAULT_MESSAGE_LOGLEVEL
>
> Well, I can't say I like it - we have the config item
> CONFIG_DEFAULT_MESSAGE_LOGLEVEL and DEFAULT_MESSAGE_LOGLEVEL resembles
> it for a reason - it is the corresponding define coming from .config.
>
> With this change you have:
>
> CONFIG_DEFAULT_MESSAGE_LOGLEVEL
>         MESSAGE_LOGLEVEL_DEFAULT
>
> which is more confusing. To me at least. I can't see the resemblance at
> a quick glance anymore.

Yes I realized this just sort of moved that sort of problem
to a different place.  The change was responding to the
inconsistency in naming in "printk.c".  I can control the
effects of that, but I can't predict who might be using
various config options, so I avoided doing that rename.

Was I being overly cautious on the config option name?
I could fix that too and have consistency everywhere.

					-Alex

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Borislav Petkov July 9, 2014, 3:13 p.m. UTC | #3
On Wed, Jul 09, 2014 at 10:10:28AM -0500, Alex Elder wrote:
> Yes I realized this just sort of moved that sort of problem
> to a different place.  The change was responding to the
> inconsistency in naming in "printk.c".  I can control the
> effects of that, but I can't predict who might be using
> various config options, so I avoided doing that rename.
> 
> Was I being overly cautious on the config option name?
> I could fix that too and have consistency everywhere.

You mean turn it into CONFIG_MESSAGE_LOGLEVEL_DEFAULT?

I think you're free to do so because .config defines are not API anyway
and anyone who thinks so should get off the bad sh*t he's smoking.

:-)
Alex Elder July 9, 2014, 3:14 p.m. UTC | #4
On 07/09/2014 10:13 AM, Borislav Petkov wrote:
> On Wed, Jul 09, 2014 at 10:10:28AM -0500, Alex Elder wrote:
>> Yes I realized this just sort of moved that sort of problem
>> to a different place.  The change was responding to the
>> inconsistency in naming in "printk.c".  I can control the
>> effects of that, but I can't predict who might be using
>> various config options, so I avoided doing that rename.
>>
>> Was I being overly cautious on the config option name?
>> I could fix that too and have consistency everywhere.
>
> You mean turn it into CONFIG_MESSAGE_LOGLEVEL_DEFAULT?

OK, I'll repost a little later with that change included.
Thanks.

					-Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Borislav Petkov July 9, 2014, 3:17 p.m. UTC | #5
On Wed, Jul 09, 2014 at 10:14:54AM -0500, Alex Elder wrote:
> OK, I'll repost a little later with that change included.

I'd wait a couple of days for the others to have a look too, if I were
you. Flooding people can be counterproductive. :-)
diff mbox

Patch

diff --git a/include/linux/printk.h b/include/linux/printk.h
index 319ff7e..3d1ccad 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -31,7 +31,7 @@  static inline const char *printk_skip_level(const char *buffer)
 }
 
 /* printk's without a loglevel use this.. */
-#define DEFAULT_MESSAGE_LOGLEVEL CONFIG_DEFAULT_MESSAGE_LOGLEVEL
+#define MESSAGE_LOGLEVEL_DEFAULT CONFIG_DEFAULT_MESSAGE_LOGLEVEL
 
 /* We show everything that is MORE important than this.. */
 #define CONSOLE_LOGLEVEL_SILENT  0 /* Mum's the word */
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 13e839d..ac2b64e 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -56,7 +56,7 @@ 
 
 int console_printk[4] = {
 	CONSOLE_LOGLEVEL_DEFAULT,	/* console_loglevel */
-	DEFAULT_MESSAGE_LOGLEVEL,	/* default_message_loglevel */
+	MESSAGE_LOGLEVEL_DEFAULT,	/* default_message_loglevel */
 	CONSOLE_LOGLEVEL_MIN,		/* minimum_console_loglevel */
 	CONSOLE_LOGLEVEL_DEFAULT,	/* default_console_loglevel */
 };