diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2019-05-27 09:25:57 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-05-28 11:58:59 +0200 |
commit | 1263d74e90c06c4170517ddc3024211e4861df6b (patch) | |
tree | b3f7fee15ff140cef9862c233b060c5a5699e6b7 | |
parent | ddf4cca3397910ed8a342c1f6443637f20bae718 (diff) | |
download | barebox-1263d74e90c06c4170517ddc3024211e4861df6b.tar.gz barebox-1263d74e90c06c4170517ddc3024211e4861df6b.tar.xz |
scripts: kwboot: fix comparison with out-of-range constant
clang detects that system char signedness will affect program runtime:
scripts/kwboot.c:395:10: warning: result of comparison of constant 255
with expression of type 'char' is always true
[-Wtautological-constant-out-of-range-compare]
if (*p != 0xff)
~~ ^ ~~~~
Fix this by using uint8_t where appropriate.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | scripts/kwboot.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/kwboot.c b/scripts/kwboot.c index df52144e45..43b8b8cbcd 100644 --- a/scripts/kwboot.c +++ b/scripts/kwboot.c @@ -378,10 +378,10 @@ kwboot_xm_resync(int fd) * there is another problem. */ int rc; - char buf[sizeof(struct kwboot_block)]; + uint8_t buf[sizeof(struct kwboot_block)]; unsigned interval = 1; unsigned len; - char *p = buf; + uint8_t *p = buf; memset(buf, 0xff, sizeof(buf)); @@ -407,7 +407,7 @@ static int kwboot_xm_sendblock(int fd, struct kwboot_block *block) { int rc, retries; - char c; + uint8_t c; retries = 16; do { |