From patchwork Wed Mar 15 10:28:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 95328 Delivered-To: patch@linaro.org Received: by 10.140.89.134 with SMTP id v6csp259082qgd; Wed, 15 Mar 2017 03:33:27 -0700 (PDT) X-Received: by 10.99.131.198 with SMTP id h189mr2877459pge.161.1489574007047; Wed, 15 Mar 2017 03:33:27 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z43si1731683plh.7.2017.03.15.03.33.26; Wed, 15 Mar 2017 03:33:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752373AbdCOKdX (ORCPT + 2 others); Wed, 15 Mar 2017 06:33:23 -0400 Received: from mail-lf0-f53.google.com ([209.85.215.53]:33870 "EHLO mail-lf0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751642AbdCOKdW (ORCPT ); Wed, 15 Mar 2017 06:33:22 -0400 Received: by mail-lf0-f53.google.com with SMTP id z15so4998524lfd.1 for ; Wed, 15 Mar 2017 03:33:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=u7Ij3F4fefDEsWlBheu46QDm4zKP/+h9VCVrHhrzSXY=; b=Lo/W8oo58WkL6EwrfJXoiQBk7OmxcCyKFgSrVnxOaIYFoOr47HPSS6BYrzAqis0DuA O0JzQ7a0snpXBjr57wqZ5F+Q1BSHvrms4wP1TDfe00UonFFCxfpCV48380D8EMzZDS9w zbmfb2fYa+oGxPywLWOEOxolsBIQvlmO/gxRw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=u7Ij3F4fefDEsWlBheu46QDm4zKP/+h9VCVrHhrzSXY=; b=oQ+3xE7Bm+jiV+sy3t0mBXjo/hadHHVoel82X+zXEUmYKz8f7HBTFPcn2DDLAR6vSL ymnFr584P6JXhsfjmot4B8dcGGM1eeWnCF60ixl3VPgwDoit2yNy6AuAuL+QrBclGRzy kH5CTexGoHvUWZ6zVE9VlRlBqeVYmD/hQbNNSXbNNsBf35FdUK7+eUKz0WMSqj1y57MG ooQqwZ4/uBaGJjQoR1lAX6hr2CTXPHFNifVnpFdhLpWEyWpOiMd9mwqVZDiNvYyVaWOn eO3aezuJ7fe9mcLANGRo8P2uj7PMk7EzhoSZ+5HNv88cibeauJXMUAafuFIA0c3jfFLF K3uw== X-Gm-Message-State: AFeK/H2CSy4tm6V5UkUVxC5zv1KTr0F0B6qxuQeZDPE3Y4KyPI2x7DQ8vZhxhGMZ8+T/MPWq X-Received: by 10.46.20.80 with SMTP id 16mr884723lju.81.1489574000197; Wed, 15 Mar 2017 03:33:20 -0700 (PDT) Received: from localhost.localdomain (nivc-213.auriga.ru. [80.240.102.213]) by smtp.gmail.com with ESMTPSA id 4sm265163ljf.33.2017.03.15.03.33.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Mar 2017 03:33:19 -0700 (PDT) From: Aleksey Makarov To: linux-serial@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Aleksey Makarov , Sudeep Holla , Greg Kroah-Hartman , Peter Hurley , Jiri Slaby , Robin Murphy , Steven Rostedt , "Nair, Jayachandran" , Sergey Senozhatsky , Petr Mladek Subject: [PATCH v5 2/3] printk: rename selected_console -> preferred_console Date: Wed, 15 Mar 2017 13:28:51 +0300 Message-Id: <20170315102854.1763-3-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170315102854.1763-1-aleksey.makarov@linaro.org> References: <20170315102854.1763-1-aleksey.makarov@linaro.org> Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org The variable selected_console is set in __add_preferred_console() to point to the last console parameter that was added to the console_cmdline array. Rename it to preferred_console so that the name reflects the usage. Petr Mladek: "[..] the selected_console/preferred_console value is used to keep the console first in the console_drivers list. IMHO, the main effect is that each line will first appear on this console, see call_console_drivers(). But the message will still appear also on all other enabled consoles. From this point, the name "preferred" sounds better to me. More consoles are selected (enabled) and only one is preferred (first)." Acked-by: Steven Rostedt (VMware) Acked-by: Petr Mladek Reviewed-by: Sergey Senozhatsky Suggested-by: Peter Hurley Signed-off-by: Aleksey Makarov --- kernel/printk/printk.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.12.0 -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 80bc1b72d03d..fd752f0c8ef1 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -270,7 +270,7 @@ static struct console *exclusive_console; static struct console_cmdline console_cmdline[MAX_CMDLINECONSOLES]; -static int selected_console = -1; +static int preferred_console = -1; int console_set_on_cmdline; EXPORT_SYMBOL(console_set_on_cmdline); @@ -1910,14 +1910,14 @@ static int __add_preferred_console(char *name, int idx, char *options, i++, c++) { if (strcmp(c->name, name) == 0 && c->index == idx) { if (!brl_options) - selected_console = i; + preferred_console = i; return 0; } } if (i == MAX_CMDLINECONSOLES) return -E2BIG; if (!brl_options) - selected_console = i; + preferred_console = i; strlcpy(c->name, name, sizeof(c->name)); c->options = options; braille_set_options(c, brl_options); @@ -2436,7 +2436,7 @@ void register_console(struct console *newcon) bcon = console_drivers; if (!has_preferred || bcon || !console_drivers) - has_preferred = selected_console >= 0; + has_preferred = preferred_console >= 0; /* * See if we want to use this console driver. If we @@ -2484,7 +2484,7 @@ void register_console(struct console *newcon) } newcon->flags |= CON_ENABLED; - if (i == selected_console) { + if (i == preferred_console) { newcon->flags |= CON_CONSDEV; has_preferred = true; }