summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2020-10-01 17:46:27 +0100
committerDavid Gibson <david@gibson.dropbear.id.au>2020-10-02 10:29:27 +1000
commitfb1f65f158327895acd360683e5c6da56d6944ea (patch)
tree5ebaffe125794ba38bcbb7299b7b083316d0084f
parentf28aa271000bfeaa765b824a8a3e7b170da12925 (diff)
downloaddevice-tree-compiler-fb1f65f158327895acd360683e5c6da56d6944ea.tar.gz
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>
-rw-r--r--libfdt/fdt_sw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libfdt/fdt_sw.c b/libfdt/fdt_sw.c
index 354f466..68b543c 100644
--- a/libfdt/fdt_sw.c
+++ b/libfdt/fdt_sw.c
@@ -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)
{
- const size_t hdrsize = FDT_ALIGN(sizeof(struct fdt_header),
- sizeof(struct fdt_reserve_entry));
+ const int hdrsize = FDT_ALIGN(sizeof(struct fdt_header),
+ sizeof(struct fdt_reserve_entry));
void *fdt = buf;
if (bufsize < hdrsize)