aboutsummaryrefslogtreecommitdiff
path: root/dtc.c
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2021-06-11 18:10:37 +0100
committerDavid Gibson <david@gibson.dropbear.id.au>2021-06-15 12:48:25 +1000
commit5bec74a6d13519381a40b5433ede7849a75a8d79 (patch)
treedcd05551805dbe75ef3c63acebe95dd509e2fc51 /dtc.c
parent24e7f511fd4acaf48d25374f88dbdbdb277e6a26 (diff)
downloaddtc-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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dtc.c b/dtc.c
index 3962d3f..bc786c5 100644
--- a/dtc.c
+++ b/dtc.c
@@ -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);