From patchwork Wed Dec 21 04:52:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 707637 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tk2N00gtyz9t0q for ; Wed, 21 Dec 2016 15:53:04 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="X1+E5dnU"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3tk2Mz5lYdzDwXN for ; Wed, 21 Dec 2016 15:53:03 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="X1+E5dnU"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mail-pg0-x244.google.com (mail-pg0-x244.google.com [IPv6:2607:f8b0:400e:c05::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3tk2Mh4sS2zDwW1 for ; Wed, 21 Dec 2016 15:52:48 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="X1+E5dnU"; dkim-atps=neutral Received: by mail-pg0-x244.google.com with SMTP id i5so5166578pgh.2 for ; Tue, 20 Dec 2016 20:52:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Lh/p7QBuI/DEtwb5XE3FtsbuSRhoi4yk8U0pbPJkLec=; b=X1+E5dnUMLhNc8lRsUXv1S60ntgLGp8eNsVza5uFEXDX2fMPPfGzPJuVW/xdQ9R41a MVOBkYvI414th8OhJ+RU2z5Ovc1nEaJyXzWUId9XbUixklgXaoxYKyIWV8WF7OqzgFl/ t0i3DA536JJw4ZoW6lyX9NWjiFQ1a125mT3QYTYk6xjWZ2dbd+KstqBKkJyC5OaJKVT7 BXRj6MkyzLA8tthcpXKp2r4StipuCjlNb1UPQzu00mI7kMrJgjZjPJd88tJV78FnBl3I OUe+5gCkXY4t/vFlCnDntdSUDOytpN/ncfEn6paRpaBczs/HmJCS6Q9u25t9DSu3A70Q 4UWA== 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=Lh/p7QBuI/DEtwb5XE3FtsbuSRhoi4yk8U0pbPJkLec=; b=Ufo0vvyIi2RlTLYAOFJ2mZNi/4Nwq0dmHJdrg5fVoo9m1fXqZ1uhLtpmBF2mWzNAQz LVKXhuEYA6H+4H+7rlqDZAX3itdr8nhYqDo3LU5G2tyuY3a7QYYFWKtbIdCk0ans3BEM Q4L9c6xt1XVyEU1R0hfrZ+mEVtEO2aw+HFOlhIXr4O4j6qK7Cy9GarjbMJY719alYceJ ffzskvKBsVRukOgH75NN4AGMejGosRzvT27zgcpUvFqi2b4/7wJFvf+svlI8BP2fWIDH CjVEp6aHaIhrXLti39qxJiGLv7IcqLWat/mofsmPjH9eB39jMOVcdp6E/Ax/jOBRIw9z XmKg== X-Gm-Message-State: AIkVDXKEBFXdg8/OgoqmZVuhVl4f/8WmppEwpsatdxtXeQPoAfc8RC5LHDet6vqy24YCtg== X-Received: by 10.99.178.6 with SMTP id x6mr4627463pge.63.1482295966867; Tue, 20 Dec 2016 20:52:46 -0800 (PST) Received: from flat-canetoad.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id 29sm1289001pfo.58.2016.12.20.20.52.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Dec 2016 20:52:46 -0800 (PST) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Wed, 21 Dec 2016 15:52:23 +1100 Message-Id: <1482295952-30060-2-git-send-email-oohall@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1482295952-30060-1-git-send-email-oohall@gmail.com> References: <1482295952-30060-1-git-send-email-oohall@gmail.com> Subject: [Skiboot] [PATCH v3 01/10] console: don't use __flush_console() outside console.c X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" There is only one use of this function outside of console.c and that usage is broken. As the name suggests this is an internal function that is only safe when the console lock held is held. flush_console() will acquire the lock for the caller so that should be used instead. Reviewed-by: Andrew Donnellan Signed-off-by: Oliver O'Halloran --- v2 -> v3: fixed the name of the function in the title --- core/console.c | 2 +- hw/fsp/fsp-console.c | 2 +- include/console.h | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/core/console.c b/core/console.c index f76ed402c48f..0e96bf4593eb 100644 --- a/core/console.c +++ b/core/console.c @@ -114,7 +114,7 @@ void clear_console(void) * Optionally can skip flushing to drivers, leaving messages * just in memory console. */ -bool __flush_console(bool flush_to_drivers) +static bool __flush_console(bool flush_to_drivers) { struct cpu_thread *cpu = this_cpu(); size_t req, len = 0; diff --git a/hw/fsp/fsp-console.c b/hw/fsp/fsp-console.c index 0080d7326f50..46ac28bbd822 100644 --- a/hw/fsp/fsp-console.c +++ b/hw/fsp/fsp-console.c @@ -751,7 +751,7 @@ void fsp_console_poll(void *data __unused) continue; } if (fs->log_port) { - __flush_console(true); + flush_console(); opal_update_pending_evt(fs->irq, 0); } else { #ifdef OPAL_DEBUG_CONSOLE_POLL diff --git a/include/console.h b/include/console.h index 5cb1227e21bd..f88547c7791e 100644 --- a/include/console.h +++ b/include/console.h @@ -59,7 +59,6 @@ extern struct lock con_lock; extern bool dummy_console_enabled(void); extern void force_dummy_console(void); extern bool flush_console(void); -extern bool __flush_console(bool flush_to_drivers); extern void set_console(struct con_ops *driver); extern void console_complete_flush(void);