From patchwork Mon Oct 19 01:51:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 532078 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3C2FC1401AD for ; Mon, 19 Oct 2015 12:52:09 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b=OpVEVf3r; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 16F1B4B6D4; Mon, 19 Oct 2015 03:52:01 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VXOuPnI5ss4Z; Mon, 19 Oct 2015 03:52:00 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 798E54B6D5; Mon, 19 Oct 2015 03:51:46 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6C39C4B67F for ; Mon, 19 Oct 2015 03:51:37 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DkMN4AMOlaFg for ; Mon, 19 Oct 2015 03:51:37 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-io0-f169.google.com (mail-io0-f169.google.com [209.85.223.169]) by theia.denx.de (Postfix) with ESMTPS id 060584B68A for ; Mon, 19 Oct 2015 03:51:33 +0200 (CEST) Received: by iofz202 with SMTP id z202so31128279iof.2 for ; Sun, 18 Oct 2015 18:51:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=FyKoDt1IKvjOb8qJtGvqUHLSeeuI5LCMj5hv6mXRK4E=; b=OpVEVf3reaNTGXIXy/C710lyw/9swLCkkp/FdqhVSRb0WAcOjeG7kPJnFDU21S9qUr S/vny5rWhrgGxxobQcRivGjqFidGyVovnB9k4mfdtG/RfIr98M0mhN813Fkrdq9xey+N 050JwpU5m7Pda/TIPsDEpeFOZYt2xODGzF9pf6OTEEB7Feb92HMczJnfRrDK11pBTpmf sHu4XQG50/rVLx3GaDrnWU/Rzt2aSwZaee20JGZx6pz4yiLNHUNYDczTc190yzZtFOLe xeNAmA4eK/B0lkDEGtXwFRFUxraM2eO1J7sgjkfrL8iWZ+uTGF2MuZdc03LAVZEf722L vFOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=FyKoDt1IKvjOb8qJtGvqUHLSeeuI5LCMj5hv6mXRK4E=; b=WdmWgdhErGG/9imZnS1Kx3KltaJNLVGUvK/A+tWO9uA5a9Kxnn477l6PZC8QRZxZCE e9Y8FxTWjwZCJFuG26b0xhARyBy31UZHO5DKNU/cNsnrtH1e2ndeuopi9e38Kb8K/OCu hzXGbAvssYd+PTUxBDxN8IJrEQGV9COEeKg2RAi0oqflaZD6ySJ49u6ik+yaLCHJ3Ffq ZuH/YvUTBOga+G8Pu7DPBjuRYsXhuZjf8GxN4VdG6P7roYaBXz6loAcG0l7Mc6XfoVXJ YYCkHyfV62PazHizJNqLb2JIH2CUx11zXMw2l4/qCsfFoGWC9wbShyNb3U64chwMl0tg Baqg== X-Gm-Message-State: ALoCoQmFIdh5coaeE92b7KGUsSQr1FbRQpaXarJhyRHSTnxtzzlCUz6DDZwLrLOTAoFIELO3hoX7 X-Received: by 10.107.30.12 with SMTP id e12mr28257889ioe.57.1445219492312; Sun, 18 Oct 2015 18:51:32 -0700 (PDT) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by smtp.gmail.com with ESMTPSA id k6sm7027317igf.11.2015.10.18.18.51.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Oct 2015 18:51:31 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id AE5F0220D0D; Sun, 18 Oct 2015 19:51:29 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Sun, 18 Oct 2015 19:51:23 -0600 Message-Id: <1445219487-24518-2-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.6.0.rc2.230.g3dd15c0 In-Reply-To: <1445219487-24518-1-git-send-email-sjg@chromium.org> References: <1445219487-24518-1-git-send-email-sjg@chromium.org> Subject: [U-Boot] [PATCH v2 1/5] debug_uart: Adjust the declaration of debug_uart_init() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" We want to be able to add other common code to this function. So change the driver's version to have an underscore before it, just like _debug_uart_putc(). Define debug_uart_init() to call this version. Update all drivers to this new method. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- Changes in v2: - Adjust all _debug_uart_init() declarations to be static inline drivers/serial/ns16550.c | 2 +- drivers/serial/serial_efi.c | 2 +- drivers/serial/serial_s5p.c | 2 +- include/debug_uart.h | 9 +++++++-- lib/efi/efi_stub.c | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index 6275a11..6433844 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -257,7 +257,7 @@ int NS16550_tstc(NS16550_t com_port) (1 << CONFIG_DEBUG_UART_SHIFT), \ CONFIG_DEBUG_UART_SHIFT) -void debug_uart_init(void) +static inline void _debug_uart_init(void) { struct NS16550 *com_port = (struct NS16550 *)CONFIG_DEBUG_UART_BASE; int baud_divisor; diff --git a/drivers/serial/serial_efi.c b/drivers/serial/serial_efi.c index cf57d89..ea25c25 100644 --- a/drivers/serial/serial_efi.c +++ b/drivers/serial/serial_efi.c @@ -107,7 +107,7 @@ static int serial_efi_pending(struct udevice *dev, bool input) * There is nothing to init here since the EFI console is already running by * the time we enter U-Boot. */ -void debug_uart_init(void) +static inline void _debug_uart_init(void) { } diff --git a/drivers/serial/serial_s5p.c b/drivers/serial/serial_s5p.c index 3f0b588..feba467 100644 --- a/drivers/serial/serial_s5p.c +++ b/drivers/serial/serial_s5p.c @@ -207,7 +207,7 @@ U_BOOT_DRIVER(serial_s5p) = { #include -void debug_uart_init(void) +static inline void _debug_uart_init(void) { struct s5p_uart *uart = (struct s5p_uart *)CONFIG_DEBUG_UART_BASE; diff --git a/include/debug_uart.h b/include/debug_uart.h index a75e377..257ba00 100644 --- a/include/debug_uart.h +++ b/include/debug_uart.h @@ -38,7 +38,7 @@ * To enable the debug UART in your serial driver: * * - #include - * - Define debug_uart_init(), trying to avoid using the stack + * - Define _debug_uart_init(), trying to avoid using the stack * - Define _debug_uart_putc() as static inline (avoiding stack usage) * - Immediately afterwards, add DEBUG_UART_FUNCS to define the rest of the * functionality (printch(), etc.) @@ -132,6 +132,11 @@ void printhex8(uint value); void printhex8(uint value) \ { \ printhex(value, 8); \ - } + } \ +\ + void debug_uart_init(void) \ + { \ + _debug_uart_init(); \ + } \ #endif diff --git a/lib/efi/efi_stub.c b/lib/efi/efi_stub.c index d4d3e49..e138709 100644 --- a/lib/efi/efi_stub.c +++ b/lib/efi/efi_stub.c @@ -59,7 +59,7 @@ struct __packed desctab_info { * considering if we start needing more U-Boot functionality. Note that we * could then move get_codeseg32() to arch/x86/cpu/cpu.c. */ -void debug_uart_init(void) +void _debug_uart_init(void) { }