diff mbox series

[3/4] cmd: mem: Use IS_ENABLED instead of alt_test variable

Message ID 20200305062132.22932-3-sr@denx.de
State Accepted
Commit f14bfa7ec6a5ec79e1c8dd48571b740922439912
Delegated to: Tom Rini
Headers show
Series [1/4] cmd: mem: Correctly count the errors in mtest | expand

Commit Message

Stefan Roese March 5, 2020, 6:21 a.m. UTC
This patch uses the IS_ENABLED() macro to check, which mtest variant
is enabled.

Signed-off-by: Stefan Roese <sr@denx.de>
---
 cmd/mem.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

Tom Rini April 21, 2020, 12:26 p.m. UTC | #1
On Thu, Mar 05, 2020 at 07:21:31AM +0100, Stefan Roese wrote:

> This patch uses the IS_ENABLED() macro to check, which mtest variant
> is enabled.
> 
> Signed-off-by: Stefan Roese <sr@denx.de>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/cmd/mem.c b/cmd/mem.c
index f519adaee2..2ccc7032ad 100644
--- a/cmd/mem.c
+++ b/cmd/mem.c
@@ -875,11 +875,6 @@  static int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc,
 	ulong errs = 0;	/* number of errors, or -1 if interrupted */
 	ulong pattern = 0;
 	int iteration;
-#if defined(CONFIG_SYS_ALT_MEMTEST)
-	const int alt_test = 1;
-#else
-	const int alt_test = 0;
-#endif
 
 	start = CONFIG_SYS_MEMTEST_START;
 	end = CONFIG_SYS_MEMTEST_END;
@@ -921,7 +916,7 @@  static int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc,
 
 		printf("Iteration: %6d\r", iteration + 1);
 		debug("\n");
-		if (alt_test) {
+		if (IS_ENABLED(CONFIG_SYS_ALT_MEMTEST)) {
 			errs = mem_test_alt(buf, start, end, dummy);
 		} else {
 			errs = mem_test_quick(buf, start, end, pattern,