From patchwork Mon Jan 25 11:45:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 60341 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp1299760lbb; Mon, 25 Jan 2016 03:45:51 -0800 (PST) X-Received: by 10.98.72.72 with SMTP id v69mr25081513pfa.100.1453722351750; Mon, 25 Jan 2016 03:45:51 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id da6si33209253pad.156.2016.01.25.03.45.51; Mon, 25 Jan 2016 03:45:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dkim=pass header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757065AbcAYLpo (ORCPT + 30 others); Mon, 25 Jan 2016 06:45:44 -0500 Received: from mail-lf0-f44.google.com ([209.85.215.44]:32867 "EHLO mail-lf0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757033AbcAYLpi (ORCPT ); Mon, 25 Jan 2016 06:45:38 -0500 Received: by mail-lf0-f44.google.com with SMTP id m198so82888246lfm.0 for ; Mon, 25 Jan 2016 03:45:37 -0800 (PST) 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=nPsK6mUaJIs2IhcmSwwPtcRLd5asgMZLViN9B0s5xd0=; b=RPFYb4DjqFOj7uU5VnS3Cj+WxjyCzjZEIDj/nYQpbdfMiE1IvNse96rgfO/tF1TL8k JiLLGrZye021S4AnE3wWDmh6DO4TgUKoR/5HjWlEL+o1NCqPZeaYrVJjGwmRrkg8yEuq 8fKqKRHmrXrk9REL6PrdTfxwAssU+IEM9LMbc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nPsK6mUaJIs2IhcmSwwPtcRLd5asgMZLViN9B0s5xd0=; b=B+SKro/kJjuaPdEEr773pGIFHoHdFzye5SYZtfBw9dw+CeQNncy1w4XfxS5HlGK4Ct NPIkjqcSTeVSNTdbOcjMB2mIFPmywSRqsSHLuWB8dLcYuGXF2dmNve6RaChWLkiHdRhe VC+RPwTyAAeMJMbCqs4OkMEOlct6VqfcgDNqqZ3EB/IveMHgymzIsuwjhzK8Dp0Yo4Bo qWKoDgJZXk7zhqk4oagdKl5OVJBFzyLfrk7RL+xJYoyxscLiFFaYoLizGu5dpPny5ENq 2VMXUuXeABJAwafaGeOpXcwKt0azFK31xUJaLiB3Lk30/L0RmFONg+YJ0ltu7RMsikFD HKog== X-Gm-Message-State: AG10YOSDj8aD2DX0Zwm/XraNwMoGm3xbzN9qY001uqRoVlsCYckIa/a7qsVVQB7nDY8UTlYo X-Received: by 10.25.141.129 with SMTP id p123mr4924934lfd.65.1453722336349; Mon, 25 Jan 2016 03:45:36 -0800 (PST) Received: from lemon.localdomain (host-2-60-44-52.pppoe.omsknet.ru. [2.60.44.52]) by smtp.gmail.com with ESMTPSA id jx8sm2662527lbc.29.2016.01.25.03.45.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Jan 2016 03:45:35 -0800 (PST) From: Aleksey Makarov To: linux-acpi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org, Aleksey Makarov , Graeme Gregory , Russell King , Greg Kroah-Hartman , "Rafael J . Wysocki" , Leif Lindholm Subject: [PATCH 1/3] printk: make preferred_console local static bool Date: Mon, 25 Jan 2016 17:45:21 +0600 Message-Id: <1453722324-22407-2-git-send-email-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1453722324-22407-1-git-send-email-aleksey.makarov@linaro.org> References: <1453722324-22407-1-git-send-email-aleksey.makarov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The variable preferred_console is used only inside register_console() and it's semantics is boolean. Make it clear. Signed-off-by: Aleksey Makarov --- kernel/printk/printk.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.7.0 diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 2ce8826..37e531f 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -143,7 +143,6 @@ 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); @@ -2456,6 +2455,7 @@ void register_console(struct console *newcon) unsigned long flags; struct console *bcon = NULL; struct console_cmdline *c; + static bool preferred_console; if (console_drivers) for_each_console(bcon) @@ -2482,15 +2482,15 @@ void register_console(struct console *newcon) if (console_drivers && console_drivers->flags & CON_BOOT) bcon = console_drivers; - if (preferred_console < 0 || bcon || !console_drivers) - preferred_console = selected_console; + if (!preferred_console || bcon || !console_drivers) + preferred_console = selected_console >= 0; /* * See if we want to use this console driver. If we * didn't select a console we take the first one * that registers here. */ - if (preferred_console < 0) { + if (!preferred_console) { if (newcon->index < 0) newcon->index = 0; if (newcon->setup == NULL || @@ -2498,7 +2498,7 @@ void register_console(struct console *newcon) newcon->flags |= CON_ENABLED; if (newcon->device) { newcon->flags |= CON_CONSDEV; - preferred_console = 0; + preferred_console = true; } } } @@ -2533,7 +2533,7 @@ void register_console(struct console *newcon) newcon->flags |= CON_ENABLED; if (i == selected_console) { newcon->flags |= CON_CONSDEV; - preferred_console = selected_console; + preferred_console = true; } break; }