summaryrefslogtreecommitdiffstats
path: root/common/cmd_itest.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-05-30 14:41:49 -0600
committerTom Rini <trini@ti.com>2014-06-05 14:38:38 -0400
commitc9bcb6f13d08caa1db13bb8067941340eb3546d8 (patch)
tree895a63a7bb72bfab0b677463de050615c0c43c20 /common/cmd_itest.c
parent93ce7561cb59809c787c3650d791217d2e395f1d (diff)
downloadblackbird-obmc-uboot-c9bcb6f13d08caa1db13bb8067941340eb3546d8.tar.gz
blackbird-obmc-uboot-c9bcb6f13d08caa1db13bb8067941340eb3546d8.zip
Fix itest mask overflow
The mask value used in itest overflows and therefore it can return an incorrect result for something like 'itest 0 == 1'. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/cmd_itest.c')
-rw-r--r--common/cmd_itest.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/cmd_itest.c b/common/cmd_itest.c
index ae2527bfec..76af62b46e 100644
--- a/common/cmd_itest.c
+++ b/common/cmd_itest.c
@@ -63,7 +63,7 @@ static long evalexp(char *s, int w)
l = simple_strtoul(s, NULL, 16);
}
- return (l & ((1 << (w * 8)) - 1));
+ return l & ((1UL << (w * 8)) - 1);
}
static char * evalstr(char *s)
OpenPOWER on IntegriCloud