From nobody Mon Feb 9 01:29:22 2026 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 180D12D0618 for ; Fri, 6 Feb 2026 16:50:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770396619; cv=none; b=PlzFKghkaROQxWuJVCVLi8Sky0c4AGwvuBkMAfi0vQBjsTmYT2R8RoZuD2HnGyegizq80Iduh+8APHjLI+xqTR+ls0/nmddhyW64pSPiU8F6taNfTgFgCORUY79lDbYg2MbWo2pjSQquKA1/6aIoVNmHNDxo25oNXLKVYh8ShHQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770396619; c=relaxed/simple; bh=16M87YMMgnDwGXYTtmn47csCiJDq7ssJmu3wrwwjVr8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XnbstDitKaI3ybXaY0ZCT6BlKrIW7zMlWHsxYIsxn1iY1cTtyCHEh0W5lYHcxVMc/65lTdHkFZ1PJm5WoR0/v4FA73XduC9y39CSEnDRBiZ/YYZGPUW66Hi1gqyD/nO9ijrY5G0tCWd/7LErdNlRqzq73Dq/973hMJ5eGPsGCbE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=Y1P0dIIo; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=Y1P0dIIo; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="Y1P0dIIo"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="Y1P0dIIo" Received: from pathway.suse.cz (unknown [IPv6:2a07:de40:b2bf:1b::12bd]) by smtp-out1.suse.de (Postfix) with ESMTP id 3A1D53E6E0; Fri, 6 Feb 2026 16:50:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1770396617; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QH8USeECcVWaCI8iNAt8Qkkcup8PFWjmSXy18CX47sY=; b=Y1P0dIIoRp2hW7zziFOCal6XhAwWkXcJkeIyu81xSHf2C+KTcHjp2QQeZwbGSOu4G2Ca77 Dms5L0J1oouYACLAgF7i+9MzA85x/kSovSxTeT8QXTXK9uV/lLi0o7P7n4aTfdOTaLd5dA U0NUDkfA0+1BBxWT42LgXWWajP0699U= Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.com header.s=susede1 header.b=Y1P0dIIo DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1770396617; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QH8USeECcVWaCI8iNAt8Qkkcup8PFWjmSXy18CX47sY=; b=Y1P0dIIoRp2hW7zziFOCal6XhAwWkXcJkeIyu81xSHf2C+KTcHjp2QQeZwbGSOu4G2Ca77 Dms5L0J1oouYACLAgF7i+9MzA85x/kSovSxTeT8QXTXK9uV/lLi0o7P7n4aTfdOTaLd5dA U0NUDkfA0+1BBxWT42LgXWWajP0699U= From: Petr Mladek To: John Ogness Cc: Sergey Senozhatsky , Steven Rostedt , Marcos Paulo de Souza , Chris Down , linux-kernel@vger.kernel.org, Petr Mladek Subject: [PATCH 2/8] printk: Rename preferred_console to preferred_dev_console Date: Fri, 6 Feb 2026 17:49:56 +0100 Message-ID: <20260206165002.496724-3-pmladek@suse.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260206165002.496724-1-pmladek@suse.com> References: <20260206165002.496724-1-pmladek@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [16.67 / 50.00]; SPAM_FLAG(5.00)[]; NEURAL_SPAM_LONG(3.50)[1.000]; BAYES_HAM(-3.00)[99.99%]; NEURAL_SPAM_SHORT(2.98)[0.994]; HFILTER_HOSTNAME_UNKNOWN(2.50)[]; RDNS_NONE(2.00)[]; ONCE_RECEIVED(1.20)[]; HFILTER_HELO_IP_A(1.00)[pathway.suse.cz]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; HFILTER_HELO_NORES_A_OR_MX(0.30)[pathway.suse.cz]; R_DKIM_ALLOW(-0.20)[suse.com:s=susede1]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b2bf:1b::12bd:from]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCPT_COUNT_SEVEN(0.00)[7]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:mid,suse.com:dkim,suse.com:email,pathway.suse.cz:helo]; DIRECT_TO_MX(0.00)[git-send-email 2.52.0]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; FROM_EQ_ENVFROM(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b2bf:1b::12bd:from]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; DNSWL_BLOCKED(0.00)[2a07:de40:b2bf:1b::12bd:from]; DKIM_TRACE(0.00)[suse.com:+] X-Spam-Flag: YES X-Spamd-Bar: ++++++++++++++++ X-Rspamd-Queue-Id: 3A1D53E6E0 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Action: add header X-Spam-Level: **************** X-Spam-Score: 16.67 X-Spam: Yes Content-Type: text/plain; charset="utf-8" The preferred_consoles[] array stores information about consoles requested via the command line, SPCR, Device Tree, or platform-specific code. Within this array, the 'preferred_console' variable tracks the specific index that should be associated with /dev/console (typically the last non-braille console defined). The current name "preferred_console" is ambiguous and leads to confusion. It does not clearly communicate why one console is "more preferred" than others in the array. Furthermore, entries for Braille consoles can exist within the preferred_consoles[] array, yet they are never associated with /dev/console and do not receive standard printk() output. Consequently, the 'preferred_console' index must skip these entries, which is not immediately obvious from the name. Rename the variable to 'preferred_dev_console' to explicitly clarify its role in identifying which entry is linked to /dev/console. Signed-off-by: Petr Mladek --- kernel/printk/printk.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 86a908e74445..3f856a438e74 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -364,7 +364,7 @@ static int console_locked; =20 static struct preferred_console preferred_consoles[MAX_PREFERRED_CONSOLES]; =20 -static int preferred_console =3D -1; +static int preferred_dev_console =3D -1; int console_set_on_cmdline; EXPORT_SYMBOL(console_set_on_cmdline); =20 @@ -2534,7 +2534,7 @@ static int __add_preferred_console(const char *name, = const short idx, if ((name && strcmp(pc->name, name) =3D=3D 0 && pc->index =3D=3D idx) || (devname && strcmp(pc->devname, devname) =3D=3D 0)) { if (!brl_options) - preferred_console =3D i; + preferred_dev_console =3D i; set_user_specified(pc, user_specified); return 0; } @@ -2542,7 +2542,7 @@ static int __add_preferred_console(const char *name, = const short idx, if (i =3D=3D MAX_PREFERRED_CONSOLES) return -E2BIG; if (!brl_options) - preferred_console =3D i; + preferred_dev_console =3D i; if (name) strscpy(pc->name, name); if (devname) @@ -3892,7 +3892,7 @@ static int try_enable_preferred_console(struct consol= e *newcon, return err; } newcon->flags |=3D CON_ENABLED; - if (i =3D=3D preferred_console) + if (i =3D=3D preferred_dev_console) newcon->flags |=3D CON_CONSDEV; return 0; } @@ -4073,7 +4073,7 @@ void register_console(struct console *newcon) * Note that a console with tty binding will have CON_CONSDEV * flag set and will be first in the list. */ - if (preferred_console < 0) { + if (preferred_dev_console < 0) { if (hlist_empty(&console_list) || !console_first()->device || console_first()->flags & CON_BOOT) { try_enable_default_console(newcon); --=20 2.52.0