From patchwork Wed Dec 26 18:57:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 208186 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 164E92C00BF for ; Thu, 27 Dec 2012 05:58:40 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A064C4A08A; Wed, 26 Dec 2012 19:58:38 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 Rnmfcb3yc00F; Wed, 26 Dec 2012 19:58:38 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6BE4C4A087; Wed, 26 Dec 2012 19:58:35 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7E1CE4A094 for ; Wed, 26 Dec 2012 19:57:43 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 fBxjOjtjDqKB for ; Wed, 26 Dec 2012 19:57:42 +0100 (CET) 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-vb0-f73.google.com (mail-vb0-f73.google.com [209.85.212.73]) by theia.denx.de (Postfix) with ESMTPS id BD3394A097 for ; Wed, 26 Dec 2012 19:57:33 +0100 (CET) Received: by mail-vb0-f73.google.com with SMTP id l1so927191vba.4 for ; Wed, 26 Dec 2012 10:57:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=FsJ3kD96SN8vkq91Ly/Hv3MgkQg0324OuSkrdfcY1RI=; b=VrXkr+Dk2Z9U2OwxXQlIYUniLmbNYRlroqhdnh1FSEEBa/0vBcBStAcJwntrTSWvdd FuGrWIcbczemGUQwiwDN9uIGAJpoMyzx6qYxmIZFhvHUMwzoeUzMM/FuJ8lSGMs/FeiJ wQSn4Dj/2xuTjNZyn1D3hvDmXSEeLWq3KMAXpUJ4UkPGrwckB8PZceCoyK9VPMxc05TN 1NpHXMA3LBCSWQjI7Ugca3lc9zSCpHwsfod7Yo6iSQLCogmBJKIl4DAgmFVBMGG+kJZK kZH08R5BsRXJ53ThOB4ocZ9I3HG2WsK92owc7XMoJ1mjmSpEE+LiL5UHUpSi1GzADFxV Vejw== X-Received: by 10.236.187.104 with SMTP id x68mr12738102yhm.43.1356548252025; Wed, 26 Dec 2012 10:57:32 -0800 (PST) Received: from wpzn4.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id l20si2352311yhi.2.2012.12.26.10.57.32 (version=TLSv1/SSLv3 cipher=AES128-SHA); Wed, 26 Dec 2012 10:57:32 -0800 (PST) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by wpzn4.hot.corp.google.com (Postfix) with ESMTP id E5E14820055; Wed, 26 Dec 2012 10:57:31 -0800 (PST) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id C6C68160F12; Wed, 26 Dec 2012 10:57:31 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Date: Wed, 26 Dec 2012 10:57:11 -0800 Message-Id: <1356548233-5570-19-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1356548233-5570-1-git-send-email-sjg@chromium.org> References: <1356548233-5570-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQm1i2QCl3ZFq5y2IYQ5mzdhwOax386axceIGu4KPj9SeOlK5DuzFZrrYFQj2psbNUzteptwCr9N3imipcw8AvblaPD4sdvV7RcCY0qk6LC5E6v8F892CLhM7pFIQqoor7ikcpPJImfPTYZKeEAxau6V9ERH0zQhzj/StZvXQojdtGuQgbepMX3/562QvlCzRd9/JI5t Cc: Tom Rini , Joe Hershberger , Kumar Gala Subject: [U-Boot] [PATCH 18/20] Move CONFIG_SYS_MEMTEST_SCRATCH #ifdef to top of file X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This config effectively has a default value of 0, so add this setting at the top of the code to remove an #ifdef in the C function. Signed-off-by: Simon Glass --- common/cmd_mem.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/cmd_mem.c b/common/cmd_mem.c index 701157d..f83acdf 100644 --- a/common/cmd_mem.c +++ b/common/cmd_mem.c @@ -36,6 +36,10 @@ #include #include +#ifndef CONFIG_SYS_MEMTEST_SCRATCH +#define CONFIG_SYS_MEMTEST_SCRATCH 0 +#endif + static int mod_mem(cmd_tbl_t *, int, int, int, char * const []); /* Display values from last command. @@ -636,11 +640,7 @@ static ulong mem_test_alt(ulong start_addr, ulong end_addr) vu_long temp; vu_long anti_pattern; vu_long num_words; -#if defined(CONFIG_SYS_MEMTEST_SCRATCH) vu_long *dummy = (vu_long *)CONFIG_SYS_MEMTEST_SCRATCH; -#else - vu_long *dummy = NULL; /* yes, this is address 0x0, not NULL */ -#endif static const ulong bitpattern[] = { 0x00000001, /* single bit */ 0x00000003, /* two adjacent bits */