projects
/
platform
/
kernel
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
93ce756
)
Fix itest mask overflow
author
Simon Glass
<sjg@chromium.org>
Fri, 30 May 2014 20:41:49 +0000
(14:41 -0600)
committer
Tom Rini
<trini@ti.com>
Thu, 5 Jun 2014 18:38:38 +0000
(14:38 -0400)
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>
common/cmd_itest.c
patch
|
blob
|
history
diff --git
a/common/cmd_itest.c
b/common/cmd_itest.c
index ae2527bfecdb8e2d55ad211bf6de6715a922f752..76af62b46ee274841a65c0eb8f040d75aa2ad02b 100644
(file)
--- 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)