Skip to content

Commit

Permalink
printk: Remove write only variable nr_ext_console_drivers
Browse files Browse the repository at this point in the history
Commit a699449 ("printk: refactor and rework printing logic")
removed the need for @nr_ext_console_drivers. Remove the unneeded
variable.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20220924000454.3319186-4-john.ogness@linutronix.de
  • Loading branch information
Thomas Gleixner authored and Petr Mladek committed Sep 29, 2022
1 parent e3f12f0 commit 7fc11a5
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions kernel/printk/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,6 @@ int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write,
}
#endif /* CONFIG_PRINTK && CONFIG_SYSCTL */

/* Number of registered extended console drivers. */
static int nr_ext_console_drivers;

/*
* Helper macros to handle lockdep when locking/unlocking console_sem. We use
* macros instead of functions so that _RET_IP_ contains useful information.
Expand Down Expand Up @@ -3188,9 +3185,6 @@ void register_console(struct console *newcon)
console_drivers->next = newcon;
}

if (newcon->flags & CON_EXTENDED)
nr_ext_console_drivers++;

newcon->dropped = 0;
if (newcon->flags & CON_PRINTBUFFER) {
/* Get a consistent copy of @syslog_seq. */
Expand Down Expand Up @@ -3256,9 +3250,6 @@ int unregister_console(struct console *console)
if (res)
goto out_disable_unlock;

if (console->flags & CON_EXTENDED)
nr_ext_console_drivers--;

/*
* If this isn't the last console and it has CON_CONSDEV set, we
* need to set it on the next preferred console.
Expand Down

0 comments on commit 7fc11a5

Please sign in to comment.