From: Simon Glass Date: Fri, 30 May 2014 20:41:49 +0000 (-0600) Subject: Fix itest mask overflow X-Git-Tag: v2014.07-rc3~35 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c9bcb6f13d08caa1db13bb8067941340eb3546d8;p=u-boot 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 --- 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)