From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (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 07DDE37474E for ; Tue, 2 Jun 2026 08:53:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780390437; cv=none; b=bLyEyPl+rWXV1Svdez/RlUp4P3Y/cHKXlHBksOURHq0p7kSJGl+KCpcoVVJZQGB7fogB6RGfGu4NUuUAzVUJHX/i5M7+uDe/Si4nuRdjqhXZn5JRhX2taEWyfh5CaYshSzrbsgKGfvxuIlyRyjHlEQs+spytvqvLkmpO1qJE/rQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780390437; c=relaxed/simple; bh=ZlEGZtuIzhaUow43aIg5o8T4ZkO0L2LLu1EVJ6Ijomg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uXvQEtS9BJo4kXVwIv7CyOi3XedEXnja2Wv4R9I5mM/XLXufqP75hY/X8aXc/Xo2zHuorcTI4DJ3Q62K1cedv5HEdbeo3bYIPVrBOFkWtRy2TD1Ub9droTfv+Ot505kFhNyq9Gm8OmNWNTtGIdwPKbKuk7uCeWxSEaKGaDeUmTY= 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 (2048-bit key) header.d=suse.com header.i=@suse.com header.b=aU8udB0Z; arc=none smtp.client-ip=209.85.221.46 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 (2048-bit key) header.d=suse.com header.i=@suse.com header.b="aU8udB0Z" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-46013161068so894304f8f.2 for ; Tue, 02 Jun 2026 01:53:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1780390434; x=1780995234; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jIIoyPD3WCWKj/iuMX1hEITbdkrDqtAEyKoDLeoz0l0=; b=aU8udB0ZnAg+YTPX0yD37w6eD95WItuVPi76Yx2Unul/jAMQOUgV5w2LAzMh/4zq2o 8hyDsSos6MkGZ9TKMn/Y+aTbZwU+OD03JxLV7j0PLw65w894wFjPevF8SIAbsCm7sLQo qytVjaPZBteUu0XCvy26FDVXIzh4wa3ItKvRhT2IivOrOCV2LyPHWV1BcbTv3ZL7K2as W0etgqHbey6QxlWQrIS3zfZaf1BmsRXRwHjiHy/PfGNz/FZzK5KyM/HJsDEoD35RFWTw jpZnoz5SRqRQRh47u0h2/AVBXFn8HDe0Q5WWl25sL6YPahqPruw7rhXSRIJMZl1Jqa++ md3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780390434; x=1780995234; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=jIIoyPD3WCWKj/iuMX1hEITbdkrDqtAEyKoDLeoz0l0=; b=sifvVHSo5dM39PLTy2Yn+yVuImwzsyCRZxBYtCtUYsnT7BON2TknSW56ePk238J4NL KEL3YO35WLHbF0qFZZJvaAYyjg4TWKmiCLGXhpeaPVOVTJkOPsIRBn3hnnjuxClNc+h5 clhPq7eyTBE54shTfMkw8rX6ZAdoxeLUzCs6kM9zXP5xBjQ+OAzms/e423TDfSnI4dtV 10sEE7gxD3Cln95Wz+LcaoDN9fe5whlZu9BojUNWWe0J2nrnMmprQ1nRbLbpf6ew4M+6 v0lFTO2lALwN4GHAvrCUxuNOGMo78s1utqlPEMPjJhPAAnka+I2+YhIvjih1/YR6YDiD gAyQ== X-Forwarded-Encrypted: i=1; AFNElJ/FPjkbxe84cT0P3i1Tvrbsfwblv03AiaG7FThftmJe4R3Zu3RJ8JuF+wG0y50xbhaQ08LyYQMqBgwCk+c=@vger.kernel.org X-Gm-Message-State: AOJu0YzYxP5LbU5/5M+13177vfoPEvShk91CajlUXjnimlNA3XT3mz3K DFVTeIyO1dKhhBy/0QQaJ+AAIHK8xkvZFc/iCrUBXBpCfoFEKTUCUahs9pGNYKbctbd+U9KrpmK UpiGR X-Gm-Gg: Acq92OEE8Sz2UV0rsYe+z2K5MyhjiC2fwK3jzrwFt3VEbN0y3t0p3wJAKfjVTkY3ntO Uf+Vj0sSPp89nkDlvlQD90wNIql6qVPY0EaKEcQjUYeWnTjLyolP1nfnaB+6vetfJPgS14KCEbT LP6NPKSKm0x0yy5Z5vUWX4AagE9RsLMc/0xt/qAykWM1n+or1Gla0vsS20i0sWA2i1vEO9AoObc 89B5GhkOyA1gj5lYnVKdbB19TuVUMl2DMqf1G4uw0Jeo5aUmdbAZSA7W00R8kjCAXAj23APrIxf sSYRocNMMMQyVHUTvNxMgrGMAgqE9ijPGCJ0tYe1cOUzX33VzG154E9crWGKH3kK4FzV20IboiP eDEnbgPUXEkDREs75uymWjdKYAPGkeONB7pJBIK8ofNhvB1l9C4Q2zEJSgrsUMiUVAaAOwqYqNp EI9dW1+gKlEF9JGFlkp0mSwBNjkP9Hlvd5L7Do X-Received: by 2002:a5d:5d12:0:b0:460:194d:8df2 with SMTP id ffacd0b85a97d-460194d9727mr4624778f8f.3.1780390434371; Tue, 02 Jun 2026 01:53:54 -0700 (PDT) Received: from pathway.suse.cz ([176.114.240.130]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45ef354bb62sm30235496f8f.19.2026.06.02.01.53.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:53:54 -0700 (PDT) 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 v3 02/11] printk: Rename preferred_console to preferred_dev_console Date: Tue, 2 Jun 2026 10:53:03 +0200 Message-ID: <20260602085312.228251-3-pmladek@suse.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260602085312.228251-1-pmladek@suse.com> References: <20260602085312.228251-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: 8bit 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. No behavior change. Signed-off-by: Petr Mladek Acked-by: Chris Down Acked-by: Marcos Paulo de Souza Reviewed-by: John Ogness --- 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 f1e2bc74f1c0..5938e9df7345 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -366,7 +366,7 @@ static int console_locked; static struct preferred_console preferred_consoles[MAX_PREFERRED_CONSOLES]; -static int preferred_console = -1; +static int preferred_dev_console = -1; int console_set_on_cmdline; EXPORT_SYMBOL(console_set_on_cmdline); @@ -2587,7 +2587,7 @@ static int __add_preferred_console(const char *name, const short idx, if ((name && strcmp(pc->name, name) == 0 && pc->index == idx) || (devname && strcmp(pc->devname, devname) == 0)) { if (!brl_options) - preferred_console = i; + preferred_dev_console = i; set_user_specified(pc, user_specified); return 0; } @@ -2595,7 +2595,7 @@ static int __add_preferred_console(const char *name, const short idx, if (i == MAX_PREFERRED_CONSOLES) return -E2BIG; if (!brl_options) - preferred_console = i; + preferred_dev_console = i; if (name) strscpy(pc->name, name); if (devname) @@ -3931,7 +3931,7 @@ static int try_enable_preferred_console(struct console *newcon, return err; } newcon->flags |= CON_ENABLED; - if (i == preferred_console) + if (i == preferred_dev_console) newcon->flags |= CON_CONSDEV; return 0; } @@ -4112,7 +4112,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); -- 2.54.0