diff options
Diffstat (limited to 'tools/kwbimage.h')
-rw-r--r-- | tools/kwbimage.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/kwbimage.h b/tools/kwbimage.h index 8d37357e5ab..9ebc7d72d36 100644 --- a/tools/kwbimage.h +++ b/tools/kwbimage.h @@ -208,7 +208,7 @@ static inline size_t kwbheader_size(const void *header) const struct main_hdr_v0 *hdr = header; return sizeof(*hdr) + - (hdr->ext & 0x1) ? sizeof(struct ext_hdr_v0) : 0; + hdr->ext ? sizeof(struct ext_hdr_v0) : 0; } else { const struct main_hdr_v1 *hdr = header; @@ -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; @@ -252,7 +252,7 @@ static inline struct opt_hdr_v1 *opt_hdr_v1_first(void *img) { return NULL; mhdr = img; - if (mhdr->ext & 0x1) + if (mhdr->ext) return (struct opt_hdr_v1 *)(mhdr + 1); else return NULL; @@ -272,7 +272,7 @@ static inline struct opt_hdr_v1 *_opt_hdr_v1_next(struct opt_hdr_v1 *cur) static inline struct opt_hdr_v1 *opt_hdr_v1_next(struct opt_hdr_v1 *cur) { - if (*opt_hdr_v1_ext(cur) & 0x1) + if (*opt_hdr_v1_ext(cur)) return _opt_hdr_v1_next(cur); else return NULL; |