diff options
Diffstat (limited to 'include/image-metadata.h')
-rw-r--r-- | include/image-metadata.h | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/include/image-metadata.h b/include/image-metadata.h index a9cb9cfe8f..e00c209aed 100644 --- a/include/image-metadata.h +++ b/include/image-metadata.h @@ -67,7 +67,7 @@ struct imd_entry_crc32 { static inline int imd_is_crc32(uint32_t type) { - return (type & IMD_TYPE_CRC32) ? 1 : 0; + return type == IMD_TYPE_CRC32; } static inline int imd_crc32_is_valid(uint32_t flags) @@ -125,10 +125,10 @@ int imd_verify_crc32(void *buf, size_t size); #ifdef __BAREBOX__ #include <linux/stringify.h> +#include <linux/compiler_types.h> #define __BAREBOX_IMD_SECTION(_section) \ - __attribute__ ((unused,section (__stringify(_section)))) \ - __attribute__((aligned(4))) + __ll_elem(_section) __attribute__((aligned(4))) #define BAREBOX_IMD_TAG_STRING(_name, _type, _string, _keep_if_unused) \ const struct imd_entry_string __barebox_imd_##_name \ @@ -139,12 +139,12 @@ int imd_verify_crc32(void *buf, size_t size); } #define BAREBOX_IMD_CRC(_name, _crc, _keep_if_unused) \ - const struct imd_entry_crc32 __barebox_imd_##__name \ - __BAREBOX_IMD_SECTION(.barebox_imd_ ## _keep_if_unused ## _ ## _name) = { \ + const struct imd_entry_crc32 __barebox_imd_##__name \ + __BAREBOX_IMD_SECTION(.barebox_imd_ ## _keep_if_unused ## _ ## _name) = { \ .header.type = cpu_to_le32(IMD_TYPE_CRC32), \ .header.datalength = cpu_to_le32(sizeof(uint32_t) * 2), \ .data = _crc, \ - } + } #ifdef CONFIG_IMD void imd_used(const void *); @@ -156,10 +156,12 @@ static inline void imd_used(const void *unused) #define IMD_USED(_name) \ imd_used(&__barebox_imd_##_name) -#define IMD_USED_OF(_name) ({ \ - extern char __barebox_imd_OF_ ## _name[]; \ - imd_used(&__barebox_imd_OF_ ## _name); \ - }) + +__attribute__((deprecated("IMD entries are now always referenced if DT itself is"))) +static inline void IMD_USED_OF(void) +{} + +#define IMD_USED_OF(_name) IMD_USED_OF() #endif /* __BAREBOX__ */ |