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: 8107381 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A5E5CBEEE5 for ; Mon, 25 Jan 2016 11:47:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E08DA202F8 for ; Mon, 25 Jan 2016 11:47:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1AF53202F0 for ; Mon, 25 Jan 2016 11:47:46 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aNfbA-0006K1-5U; Mon, 25 Jan 2016 11:46:20 +0000 Received: from mail-lf0-x22c.google.com ([2a00:1450:4010:c07::22c]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aNfao-00062F-C9 for linux-arm-kernel@lists.infradead.org; Mon, 25 Jan 2016 11:45:59 +0000 Received: by mail-lf0-x22c.google.com with SMTP id h129so83501533lfh.3 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=RenTPeMK9r3PpC+c6CEzDfrqNv/0AV88E4/dYwPiJhx4VjA5V/J9TFWS4AftrolNlf pALK9g92P8tD3uyE4pJVxFtB0B3HibAuEriKjp7jNl3VMHkUDJCSBNvyyb3Fw+2oIukT 51FwBTumLB8BsQqu4ZYETGra8oK1waDEp2NBAW0IjyTlv6p2oCgPpWuFay5t/8fDdqj9 sRYudVezlpRwCq98Ds/Ws7Rp3ELcufw99eeVc9Os3boGnqUDG0bbI9zfmt1hfrHNLgcN 5ajCW1suNkykxoCgystm/sQnLJ72lD+OE5fEWA6VrFAYtJ035KVhBDFEfsB0ZIrf02wU wIhw== X-Gm-Message-State: AG10YOSu+dkLB5sO6pgJj9LtQjBWrOP+Xf/kdFZFX8qpC5ngsCZb+74TCdmNKYx4+hMqI8vt 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160125_034558_736093_26697E29 X-CRM114-Status: GOOD ( 14.06 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Russell King , Graeme Gregory , Greg Kroah-Hartman , "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, Leif Lindholm , Aleksey Makarov , linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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; }