[PATCH v6 11/11] printk: Purge default_console_loglevel

Chris Down posted 11 patches 3 weeks, 6 days ago
[PATCH v6 11/11] printk: Purge default_console_loglevel
Posted by Chris Down 3 weeks, 6 days ago
default_console_loglevel (then DEFAULT_LOGLEVEL) was created in Linux
0.99.13 (September 1993) to power what we now call
SYSLOG_ACTION_CONSOLE_{ON,OFF}. It was originally hardcoded to 7.

In Linux 2.3.12 (March 1997), Chris Horn made it configurable by sysctl
through kernel.printk.

Its demise came about in July 2009 in commit 1aaad49e856c ("printk:
Restore previous console_loglevel when re-enabling logging"), which
replaces default_console_loglevel with the previously used
console_loglevel. However, the documentation was never updated, and we
still kept on telling users that this sets the default value for
console_loglevel, even though this hasn't been true for over 15 years.

Purge both the documentation and all remaining references to
default_console_loglevel. It will still be initialised in the sysctl
array.

Signed-off-by: Chris Down <chris@chrisdown.name>
---
 Documentation/admin-guide/sysctl/kernel.rst | 5 ++---
 include/linux/printk.h                      | 1 -
 kernel/printk/printk.c                      | 2 +-
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst
index 6027f0057ea3..e1b5124ab383 100644
--- a/Documentation/admin-guide/sysctl/kernel.rst
+++ b/Documentation/admin-guide/sysctl/kernel.rst
@@ -1065,8 +1065,8 @@ This sysctl is deprecated and will be removed in future. Please consider using
 ``kernel.console_loglevel`` or ``kernel.default_message_loglevel`` instead.
 
 The four values in printk denote: ``console_loglevel``,
-``default_message_loglevel``, ``minimum_console_loglevel`` and
-``default_console_loglevel`` respectively.
+``default_message_loglevel``, ``minimum_console_loglevel`` and an unused legacy
+value respectively.
 
 These values influence printk() behavior when printing or
 logging error messages.
@@ -1078,7 +1078,6 @@ default_message_loglevel messages without an explicit priority
                          will be printed with this priority
 minimum_console_loglevel minimum (highest) value to which
                          console_loglevel can be set
-default_console_loglevel default value for console_loglevel
 ======================== =====================================
 
 
diff --git a/include/linux/printk.h b/include/linux/printk.h
index b7e8411e033d..41ce323b4e77 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -71,7 +71,6 @@ extern int console_printk[];
 #define console_loglevel (console_printk[0])
 #define default_message_loglevel (console_printk[1])
 #define minimum_console_loglevel (console_printk[2])
-#define default_console_loglevel (console_printk[3])
 
 extern bool ignore_per_console_loglevel;
 
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index c47dda23a7d6..018087b57031 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -65,7 +65,7 @@ int console_printk[4] = {
 	CONSOLE_LOGLEVEL_DEFAULT,	/* console_loglevel */
 	MESSAGE_LOGLEVEL_DEFAULT,	/* default_message_loglevel */
 	CONSOLE_LOGLEVEL_MIN,		/* minimum_console_loglevel */
-	CONSOLE_LOGLEVEL_DEFAULT,	/* default_console_loglevel */
+	/* legacy default console loglevel, unused */
 };
 EXPORT_SYMBOL_GPL(console_printk);
 
-- 
2.46.0
Re: [PATCH v6 11/11] printk: Purge default_console_loglevel
Posted by Petr Mladek 1 week, 3 days ago
On Mon 2024-10-28 16:46:01, Chris Down wrote:
> default_console_loglevel (then DEFAULT_LOGLEVEL) was created in Linux
> 0.99.13 (September 1993) to power what we now call
> SYSLOG_ACTION_CONSOLE_{ON,OFF}. It was originally hardcoded to 7.
> 
> In Linux 2.3.12 (March 1997), Chris Horn made it configurable by sysctl
> through kernel.printk.
> 
> Its demise came about in July 2009 in commit 1aaad49e856c ("printk:
> Restore previous console_loglevel when re-enabling logging"), which
> replaces default_console_loglevel with the previously used
> console_loglevel. However, the documentation was never updated, and we
> still kept on telling users that this sets the default value for
> console_loglevel, even though this hasn't been true for over 15 years.
> 
> Purge both the documentation and all remaining references to
> default_console_loglevel. It will still be initialised in the sysctl
> array.
> 
> Signed-off-by: Chris Down <chris@chrisdown.name>

Reviewed-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr