libfdt: fdt_create_with_flags(): Fix comparison warning
With -Wsign-compare, compilers warn about a mismatching signedness in a comparison in fdt_create_with_flags(). By making hdrsize a signed integer (we are sure it's a very small number), we avoid all the casts and have matching types. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20201001164630.4980-4-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
committed by
David Gibson
parent
f28aa27100
commit
fb1f65f158
@@ -108,8 +108,8 @@ static void *fdt_grab_space_(void *fdt, size_t len)
|
|||||||
|
|
||||||
int fdt_create_with_flags(void *buf, int bufsize, uint32_t flags)
|
int fdt_create_with_flags(void *buf, int bufsize, uint32_t flags)
|
||||||
{
|
{
|
||||||
const size_t hdrsize = FDT_ALIGN(sizeof(struct fdt_header),
|
const int hdrsize = FDT_ALIGN(sizeof(struct fdt_header),
|
||||||
sizeof(struct fdt_reserve_entry));
|
sizeof(struct fdt_reserve_entry));
|
||||||
void *fdt = buf;
|
void *fdt = buf;
|
||||||
|
|
||||||
if (bufsize < hdrsize)
|
if (bufsize < hdrsize)
|
||||||
|
|||||||
Reference in New Issue
Block a user