diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2020-10-01 09:43:37 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-10-02 06:28:15 +0200 |
commit | da4ee0d892a35216cf506199254c3ff3179d8565 (patch) | |
tree | ec6bcfc5a271036e27eea72d88e7f4f1998e45ca /scripts | |
parent | 29b4c3ca438a6fd09f49edc7e99236a694b5c931 (diff) | |
download | barebox-da4ee0d892a35216cf506199254c3ff3179d8565.tar.gz barebox-da4ee0d892a35216cf506199254c3ff3179d8565.tar.xz |
scripts: kwbimage: fix wrong return values on some errors
Coccinelle detected that bootfrom and nandeccmode are unsigned, but
check to be less than zero. Both are only used to hold the return value
of functions that either return up to 0xFF on success and a negative
error code otherwise. It's thus safe to make them signed. Do so.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/kwbimage.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/kwbimage.c b/scripts/kwbimage.c index 26eb07fa81..75c9e9cda9 100644 --- a/scripts/kwbimage.c +++ b/scripts/kwbimage.c @@ -186,7 +186,7 @@ struct image_cfg_element { } type; union { unsigned int version; - unsigned int bootfrom; + int bootfrom; struct { char *file; unsigned int args[BINARY_MAX_ARGS]; @@ -197,7 +197,7 @@ struct image_cfg_element { unsigned int execaddr; unsigned int nandblksz; unsigned int nandbadblklocation; - unsigned int nandeccmode; + int nandeccmode; unsigned int nandpagesz; struct ext_hdr_v0_reg regdata; }; |