aboutsummaryrefslogtreecommitdiff
path: root/tools/kwbimage.h
diff options
context:
space:
mode:
authorPali Rohár2022-01-12 18:20:51 +0100
committerStefan Roese2022-01-14 11:39:16 +0100
commit1a0e52f50a2085c46bf3bc5116f820a3cb655a2c (patch)
tree7d305890f3b34ec09ee4fcd4643c73af7897fd08 /tools/kwbimage.h
parent1a8e6b63e24f65b03a3997823bc4f55ecd8940ba (diff)
tools: kwbimage: Do not cast const pointers to non-const pointers
Avoid casting const to non-const. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'tools/kwbimage.h')
-rw-r--r--tools/kwbimage.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/kwbimage.h b/tools/kwbimage.h
index 8d37357e5ab..c000cba4b8d 100644
--- a/tools/kwbimage.h
+++ b/tools/kwbimage.h
@@ -235,11 +235,11 @@ static inline int opt_hdr_v1_valid_size(const struct opt_hdr_v1 *ohdr,
{
uint32_t ohdr_size;
- if ((void *)(ohdr + 1) > mhdr_end)
+ if ((const void *)(ohdr + 1) > mhdr_end)
return 0;
ohdr_size = opt_hdr_v1_size(ohdr);
- if (ohdr_size < 8 || (void *)((uint8_t *)ohdr + ohdr_size) > mhdr_end)
+ if (ohdr_size < 8 || (const void *)((const uint8_t *)ohdr + ohdr_size) > mhdr_end)
return 0;
return 1;