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: 8107371 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 22FE59F440 for ; Mon, 25 Jan 2016 11:46:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 469BF202F0 for ; Mon, 25 Jan 2016 11:46:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EC1F420304 for ; Mon, 25 Jan 2016 11:46:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756880AbcAYLpm (ORCPT ); Mon, 25 Jan 2016 06:45:42 -0500 Received: from mail-lf0-f53.google.com ([209.85.215.53]:35521 "EHLO mail-lf0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757013AbcAYLpi (ORCPT ); Mon, 25 Jan 2016 06:45:38 -0500 Received: by mail-lf0-f53.google.com with SMTP id c192so82674107lfe.2 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=BTlB9GH1XMIOldnL1O2BDsiEKL6e2a8ykvVZxNKCPoZZKC9GTwpTYYvSHzK3ZoSWew 1m3EFKPOZLRep7xz5+9IFcZvogLNfAxfYEvWAcH785htzYOE+Onsoulj1nWCRZJOYCap Yak/qIppeXL6yITHtagM/daUmCQbLXJM1jDjmdUqEpFZTpUY5mVwJ8dki/UM88O7jcCf dw9crCTMbDIZ7GCd6EbiJuKgbL4avNeOn/1vev/W1H61FSuqZO1rYqT0huYV0acReQ9+ om/lxqlitbBPpaRIZeggiBGp7hMaBsJqRzGHTRyoK2rJYtN7pI88eVQ1Qb7cfaCtG083 VQ1w== X-Gm-Message-State: AG10YOQFc7mpKfR0Lpo0DwTuCnwXhlo0hcCGPVolaue30ul2lIpVJ8S/KSKER/kK/Yy905KW 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-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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; }