From 183dfeb43ca52f13d87890f466008273c9a20e7b Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Mon, 29 Aug 2016 11:02:48 +0200 Subject: [PATCH] Fix long type support in itest command --- u-boot/common/cmd_itest.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/u-boot/common/cmd_itest.c b/u-boot/common/cmd_itest.c index df3f051..805cf12 100644 --- a/u-boot/common/cmd_itest.c +++ b/u-boot/common/cmd_itest.c @@ -70,7 +70,8 @@ extern int cmd_get_data_size(char* arg, int default_size); static long evalexp(char *s, int w) { - long l, *p; + long *p; + long l = 0; /* if the parameter starts with a * then assume is a pointer to the value we want */ if (s[0] == '*') { @@ -80,7 +81,10 @@ static long evalexp(char *s, int w) l = simple_strtoul(s, NULL, 16); } - return (l & ((1 << (w * 8)) - 1)); + if (w < 4) + return l & ((1 << (w * 8)) - 1); + else + return l; } static char * evalstr(char *s) -- 2.25.1