diff options
author | Andre Przywara <andre.przywara@arm.com> | 2021-06-11 18:10:37 +0100 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2021-06-15 12:48:25 +1000 |
commit | 5bec74a6d13519381a40b5433ede7849a75a8d79 (patch) | |
tree | dcd05551805dbe75ef3c63acebe95dd509e2fc51 /dtc.c | |
parent | 24e7f511fd4acaf48d25374f88dbdbdb277e6a26 (diff) | |
download | dtc-5bec74a6d13519381a40b5433ede7849a75a8d79.zip dtc-5bec74a6d13519381a40b5433ede7849a75a8d79.tar.gz dtc-5bec74a6d13519381a40b5433ede7849a75a8d79.tar.bz2 |
dtc: Fix signedness comparisons warnings: reservednum
With -Wsign-compare, compilers warn about a mismatching signedness
in comparisons in code using the "reservednum" variable.
There is obviously little sense in having a negative number of reserved
memory entries, so let's make this variable and all its users unsigned.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Message-Id: <20210611171040.25524-6-andre.przywara@arm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'dtc.c')
-rw-r--r-- | dtc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -12,7 +12,7 @@ * Command line options */ int quiet; /* Level of quietness */ -int reservenum; /* Number of memory reservation slots */ +unsigned int reservenum;/* Number of memory reservation slots */ int minsize; /* Minimum blob size */ int padsize; /* Additional padding to blob */ int alignsize; /* Additional padding to blob accroding to the alignsize */ @@ -197,7 +197,7 @@ int main(int argc, char *argv[]) depname = optarg; break; case 'R': - reservenum = strtol(optarg, NULL, 0); + reservenum = strtoul(optarg, NULL, 0); break; case 'S': minsize = strtol(optarg, NULL, 0); |