diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2008-07-07 10:14:15 +1000 |
---|---|---|
committer | Gerald Van Baren <vanbaren@cideas.com> | 2008-08-24 22:20:49 -0400 |
commit | c66830263af19831f2b7db307f79d1943febf7f9 (patch) | |
tree | abb2037bd454ea11f56c527ad52c66bbc7291681 /libfdt/fdt_rw.c | |
parent | ef4e8ce1beb5b93aedda5a4c1b90bfd989c6791e (diff) | |
download | u-boot-imx-c66830263af19831f2b7db307f79d1943febf7f9.zip u-boot-imx-c66830263af19831f2b7db307f79d1943febf7f9.tar.gz u-boot-imx-c66830263af19831f2b7db307f79d1943febf7f9.tar.bz2 |
dtc: Enable and fix -Wcast-qual warnings
Enabling -Wcast-qual warnings in dtc shows up a number of places where
we are incorrectly discarding a const qualification. There are also
some places where we are intentionally discarding the 'const', and we
need an ugly cast through uintptr_t to suppress the warning. However,
most of these are pretty well isolated with the *_w() functions. So
in the interests of maximum safety with const qualifications, this
patch enables the warnings and fixes the existing complaints.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Gerald Van Baren <vanbaren@cideas.com>
Diffstat (limited to 'libfdt/fdt_rw.c')
-rw-r--r-- | libfdt/fdt_rw.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libfdt/fdt_rw.c b/libfdt/fdt_rw.c index 4a16014..6837fb1 100644 --- a/libfdt/fdt_rw.c +++ b/libfdt/fdt_rw.c @@ -261,7 +261,7 @@ int fdt_set_name(void *fdt, int nodeoffset, const char *name) RW_CHECK_HEADER(fdt); - namep = (char *)fdt_get_name(fdt, nodeoffset, &oldlen); + namep = (char *)(uintptr_t)fdt_get_name(fdt, nodeoffset, &oldlen); if (!namep) return oldlen; @@ -436,7 +436,7 @@ int fdt_open_into(const void *fdt, void *buf, int bufsize) /* But if that overlaps with the old tree... */ if (((tmp + newsize) > fdtstart) && (tmp < fdtend)) { /* Try right after the old tree instead */ - tmp = (char *)fdtend; + tmp = (char *)(uintptr_t)fdtend; if ((tmp + newsize) > ((char *)buf + bufsize)) return -FDT_ERR_NOSPACE; } |