Re: [PATCH 2/3] printk: hard-code CONSOLE_LOGLEVEL_MIN in printk.c

Joe Perches
2021-02-02T12:52:58Z

On Tue, 2021-02-02 at 19:06 +0900, Sergey Senozhatsky wrote:
> On (21/02/02 16:02), Masahiro Yamada wrote:
> >  include/linux/printk.h | 1 -
> >  kernel/printk/printk.c | 2 +-
> >  2 files changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/include/linux/printk.h b/include/linux/printk.h
> > index fd34b3aa2f90..ceaf0486c01c 100644
> > --- a/include/linux/printk.h
> > +++ b/include/linux/printk.h
> > @@ -48,7 +48,6 @@ static inline const char *printk_skip_headers(const char *buffer)
> >
> >
> >  /* We show everything that is MORE important than this.. */
> >  #define CONSOLE_LOGLEVEL_SILENT 0 /* Mum's the word */
> > -#define CONSOLE_LOGLEVEL_MIN 1 /* Minimum loglevel we let people use */
> >  #define CONSOLE_LOGLEVEL_DEBUG 10 /* issue debug messages */
> >  #define CONSOLE_LOGLEVEL_MOTORMOUTH 15 /* You can't shut this one up */
> >
> >
> > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
[]
> > @@ -63,7 +63,7 @@
> >  int console_printk[4] = {
> >   CONFIG_CONSOLE_LOGLEVEL_DEFAULT, /* console_loglevel */
> >   CONFIG_MESSAGE_LOGLEVEL_DEFAULT, /* default_message_loglevel */
> > - CONSOLE_LOGLEVEL_MIN, /* minimum_console_loglevel */
> > + 1, /* minimum_console_loglevel */
> >   CONFIG_CONSOLE_LOGLEVEL_DEFAULT, /* default_console_loglevel */
>
> I personally don't think that this improves code readability.

Nor maintainability.