libfdt: libfdt_wip: Fix comparison warning
With -Wsign-compare, compilers warn about a mismatching signedness in a comparison in fdt_setprop_inplace_namelen_partial(). fdt_getprop_namelen() will only return negative error values in "proplen" if the return value is NULL. So we can rely on "proplen" being positive in our case and can safely cast it to an unsigned type. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20201001164630.4980-5-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
fb1f65f158
commit
82525f41d5
1 changed files with 1 additions and 1 deletions
|
@ -23,7 +23,7 @@ int fdt_setprop_inplace_namelen_partial(void *fdt, int nodeoffset,
|
||||||
if (!propval)
|
if (!propval)
|
||||||
return proplen;
|
return proplen;
|
||||||
|
|
||||||
if (proplen < (len + idx))
|
if ((unsigned)proplen < (len + idx))
|
||||||
return -FDT_ERR_NOSPACE;
|
return -FDT_ERR_NOSPACE;
|
||||||
|
|
||||||
memcpy((char *)propval + idx, val, len);
|
memcpy((char *)propval + idx, val, len);
|
||||||
|
|
Loading…
Reference in a new issue