From patchwork Mon Feb 25 03:33:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 222837 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 3655C2C02AE for ; Mon, 25 Feb 2013 14:37:24 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C97CB4A3EF; Mon, 25 Feb 2013 04:36:31 +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 JNWzaq01dKlX; Mon, 25 Feb 2013 04:36:31 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9313E4A1A2; Mon, 25 Feb 2013 04:34:47 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 87AB14A118 for ; Mon, 25 Feb 2013 04:34:12 +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 b+KLAFn33ltP for ; Mon, 25 Feb 2013 04:34:11 +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-vc0-f202.google.com (mail-vc0-f202.google.com [209.85.220.202]) by theia.denx.de (Postfix) with ESMTPS id 37C0C4A11A for ; Mon, 25 Feb 2013 04:33:56 +0100 (CET) Received: by mail-vc0-f202.google.com with SMTP id m8so254429vcd.3 for ; Sun, 24 Feb 2013 19:33:55 -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=8VZvGIe/z9OoCLhrFgmSyG0k4zszdn0CEaHiRUDUM60=; b=nOGSjn7Lbn3vlSCuxzYA2j9ItrlVNR8xuVQzghDOySQj7ksCDd0bTiFsaPuYtxcM9X mnV6fCS9JulpMEEwDdOTCy0dnLG45bWj56ssTKzaECuY6CajHEU5Q8Q3enoRjrYDjUx8 XhrdMLdxf8v81Z1bzZin1fksZXhPtOlvBZEJsOGGKSjU3IeKxZ9RgSO05lJfKLSV//ku Qbc0Yv1/W0HQglYR1chGm3v4FyQBYp52R9tdceWsEkw70xn/oCGB6MFvoVDKEJYIo1+Z aCnd7l1L4fSYQt+gRwPx47wr/z/ilRb/T8i3PrHB4avK99CRMxA7PMrl8IjIJnReSRUJ zGvQ== X-Received: by 10.236.181.34 with SMTP id k22mr6166697yhm.7.1361763235574; Sun, 24 Feb 2013 19:33:55 -0800 (PST) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id u21si809905yhj.0.2013.02.24.19.33.55 (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Sun, 24 Feb 2013 19:33:55 -0800 (PST) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id 6D6DD5A4102; Sun, 24 Feb 2013 19:33:55 -0800 (PST) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 4F2C81609DF; Sun, 24 Feb 2013 19:33:55 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Date: Sun, 24 Feb 2013 19:33:29 -0800 Message-Id: <1361763213-31183-20-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.8.1.3 In-Reply-To: <1361763213-31183-1-git-send-email-sjg@chromium.org> References: <1361763213-31183-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQm5LS0dYa8IDjqGBRj6728/8fnmDUTkXUQCQDrbaesFBkmFfLsZgm/mnpPWlVTjeU+saCd3xGBTNvxwXvcfuSsN8/L95SEQMPKq+PhPBak6qJUoBnFnDC3QGJZ2G+wTyIVd9KsOSyOU58EsKluAEcaoymbgVsuLelXvKXZUn2rSaPm43U1lqJIWJncyB4M5NnVVSA2K Cc: Tom Rini Subject: [U-Boot] [PATCH v3 19/22] 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 --- Changes in v3: None Changes in v2: None common/cmd_mem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/cmd_mem.c b/common/cmd_mem.c index 95b49b2..50838a7 100644 --- a/common/cmd_mem.c +++ b/common/cmd_mem.c @@ -39,6 +39,10 @@ DECLARE_GLOBAL_DATA_PTR; +#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. @@ -641,11 +645,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 */