From patchwork Tue Aug 25 05:59:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suriyan Ramasami X-Patchwork-Id: 510381 X-Patchwork-Delegate: trini@ti.com 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 427051401EF for ; Tue, 25 Aug 2015 15:59:26 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=FfREqN+V; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 096B64B67F; Tue, 25 Aug 2015 07:59:23 +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 u3K2Qfflb1Bj; Tue, 25 Aug 2015 07:59:23 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5CCCC4B66A; Tue, 25 Aug 2015 07:59:23 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8E56D4B669 for ; Tue, 25 Aug 2015 07:59:21 +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 YAKG7H9aZDRA for ; Tue, 25 Aug 2015 07:59:21 +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-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by theia.denx.de (Postfix) with ESMTPS id 0E0624B666 for ; Tue, 25 Aug 2015 07:59:17 +0200 (CEST) Received: by pabzx8 with SMTP id zx8so24469110pab.1 for ; Mon, 24 Aug 2015 22:59:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=UQSb17t5qwPyK7ruvtEql4VqH6dzHJvVYJTC+2U6Pvg=; b=FfREqN+VSm1CjbjSpX3nKF9NmzLASDAbRyIjBAERT3e5l+utY0bYSFh16rlUfwr9ns AmXXkfAnU6A4GfiYt+CXOgarm6HHYbEYl6+iHX7lzf/jrzPFqGxt5qKZFqCp0OZaRlRy 9HXJ/CMQT1vqCiPMeRrvZmGEXV7HaPOk2FmorB4Lj8ZutphgGwlaR3+IRZNFqbbps40W 1A9RzCScSf95LImZJzKrceJDa1xFt+CTP6llzp1rYWdZvaQJgAg0Qknp0lTxm1+TJt9i HshzXepE5sNlmnwaHnvZaJyGFZIeQAGFaH5q+aMsmAUgtx8pDTlEO/fgHkSUMfTwnojw /jwA== X-Received: by 10.68.191.130 with SMTP id gy2mr53608350pbc.124.1440482356183; Mon, 24 Aug 2015 22:59:16 -0700 (PDT) Received: from localhost.localdomain (c-73-170-223-86.hsd1.ca.comcast.net. [73.170.223.86]) by smtp.gmail.com with ESMTPSA id gu2sm19491325pbc.1.2015.08.24.22.59.14 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Aug 2015 22:59:14 -0700 (PDT) From: Suriyan Ramasami To: u-boot@lists.denx.de Date: Mon, 24 Aug 2015 22:59:09 -0700 Message-Id: <1440482349-12134-1-git-send-email-suriyan.r@gmail.com> X-Mailer: git-send-email 1.9.1 Cc: Tom Rini , Joe Hershberger Subject: [U-Boot] [PATCH v2 1/1] lib/display_options: Fix print_freq 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" Build without CONFIG_SPL_SERIAL_SUPPORT does not print the cpu freq. Booting an odroid U3 board, one sees this: CPU: Exynos4412 @ GHz instead of: CPU: Exynos4412 @ 1 GHz This change was done to get rid of compiler warnings related to the unused variable 'n' when CONFIG_SPL_SERIAL_SUPPORT is not defined in an SPL build. Example board: smartweb Signed-off-by: Suriyan Ramasami Acked-by: Heiko Schocher Reviewed-by: Joe Hershberger --- v2: * Get rid of variable 'n' altogether v1: * Remove #ifdef CONFIG_SPL_SERIAL_SUPPORT lib/display_options.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/display_options.c b/lib/display_options.c index df134cd..83ea4de 100644 --- a/lib/display_options.c +++ b/lib/display_options.c @@ -26,9 +26,6 @@ int display_options (void) void print_freq(uint64_t freq, const char *s) { unsigned long m = 0; -#if defined(CONFIG_SPL_SERIAL_SUPPORT) - unsigned long n; -#endif uint32_t f; static const char names[] = {'G', 'M', 'K'}; unsigned long d = 1e9; @@ -48,9 +45,6 @@ void print_freq(uint64_t freq, const char *s) } f = do_div(freq, d); -#if defined(CONFIG_SPL_SERIAL_SUPPORT) - n = freq; -#endif /* If there's a remainder, show the first few digits */ if (f) { @@ -63,9 +57,7 @@ void print_freq(uint64_t freq, const char *s) m = (m / 10) + (m % 100 >= 50); } -#if defined(CONFIG_SPL_SERIAL_SUPPORT) - printf("%lu", n); -#endif + printf("%lu", (unsigned long) freq); if (m) printf(".%ld", m); printf(" %cHz%s", c, s);