mirror of
https://github.com/dgibson/dtc.git
synced 2026-07-10 13:29:48 -04:00
livetree: Fix a comparison of integers with different signedness
On some architectures we have:
livetree.c: In function 'fixup_phandles':
livetree.c:1237:54: error: comparison of integer expressions of different signedness: 'long int' and 'unsigned int' [-Werror=sign-compare]
1237 | if (offset < 0 || offset + 4 > p->val.len) {
| ^
cc1: all warnings being treated as errors
make: *** [Makefile:307: livetree.o] Error 1
Fixes: a26ef6400b ("Restore phandle references from __fixups__ node")
Closes: https://github.com/dgibson/dtc/issues/186
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Reported-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
d245851f06
commit
c0e1d0fd58
1 changed files with 1 additions and 1 deletions
|
|
@ -1234,7 +1234,7 @@ void fixup_phandles(struct dt_info *dti, const char *name)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
offset = strtol(soffset, NULL, 0);
|
offset = strtol(soffset, NULL, 0);
|
||||||
if (offset < 0 || offset + 4 > p->val.len) {
|
if (offset < 0 || (unsigned int)offset + 4 > p->val.len) {
|
||||||
if (quiet < 1)
|
if (quiet < 1)
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Warning: Label %s contains invalid offset for property %s in node %s\n",
|
"Warning: Label %s contains invalid offset for property %s in node %s\n",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue