All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: linux-kernel@vger.kernel.org, Petr Mladek <pmladek@suse.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	John Ogness <john.ogness@linutronix.de>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Subject: [PATCH 2/3] printk: hard-code CONSOLE_LOGLEVEL_MIN in printk.c
Date: Tue,  2 Feb 2021 16:02:17 +0900	[thread overview]
Message-ID: <20210202070218.856847-2-masahiroy@kernel.org> (raw)
In-Reply-To: <20210202070218.856847-1-masahiroy@kernel.org>

CONSOLE_LOGLEVEL_MIN is only used in kernel/printk/printk.c.

You do not need to expose it to all printk() users.

I could move it to kernel/printk/printk.c, but I do not think this
macro would contribute to the code readability or maintainability.

I just hard-coded it.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 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
index 92b93340905c..7b50298d52e3 100644
--- 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 */
 };
 EXPORT_SYMBOL_GPL(console_printk);
-- 
2.27.0


  reply	other threads:[~2021-02-02  7:07 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-02  7:02 [PATCH 1/3] printk: use CONFIG_CONSOLE_LOGLEVEL_* directly Masahiro Yamada
2021-02-02  7:02 ` Masahiro Yamada
2021-02-02  7:02 ` Masahiro Yamada [this message]
2021-02-02 10:06   ` [PATCH 2/3] printk: hard-code CONSOLE_LOGLEVEL_MIN in printk.c Sergey Senozhatsky
2021-02-02 12:51     ` Joe Perches
2021-02-02  7:02 ` [PATCH 3/3] printk: move CONSOLE_EXT_LOG_MAX to kernel/printk/printk.c Masahiro Yamada
2021-02-02  8:44   ` John Ogness
2021-02-02 10:04     ` Sergey Senozhatsky
2021-02-02 12:29   ` kernel test robot
2021-02-02 12:29     ` kernel test robot
2021-02-03 13:59     ` Petr Mladek
2021-02-03 13:59       ` Petr Mladek
2021-02-02  8:38 ` [PATCH 1/3] printk: use CONFIG_CONSOLE_LOGLEVEL_* directly John Ogness
2021-02-02  8:38   ` John Ogness
2021-02-03 15:23   ` Petr Mladek
2021-02-03 15:23     ` Petr Mladek
2021-02-03 21:51     ` Masahiro Yamada
2021-02-03 21:51       ` Masahiro Yamada
2021-02-04 10:16       ` Petr Mladek
2021-02-04 10:16         ` Petr Mladek
2021-02-02 10:09 ` Sergey Senozhatsky
2021-02-02 10:09   ` Sergey Senozhatsky
2021-02-02 23:04   ` Masahiro Yamada
2021-02-02 23:04     ` Masahiro Yamada
2021-02-02 10:12 ` Greg Kroah-Hartman
2021-02-02 10:12   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210202070218.856847-2-masahiroy@kernel.org \
    --to=masahiroy@kernel.org \
    --cc=john.ogness@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.