From 2efb7ddc3b77a1ff11921083f290aebedbc935a2 Mon Sep 17 00:00:00 2001 From: Sandrine Bailleux Date: Fri, 7 Jun 2019 14:33:51 +0200 Subject: Fix type of cot_desc_ptr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The chain of trust description and the pointer pointing to its first element were incompatible, thus requiring an explicit type cast for the assignment. - cot_desc was an array of const pointers to const image descriptors. - cot_desc_ptr was a const pointer to (non-constant) pointers to const image descriptors. Thus, trying to assign cot_desc to cot_desc_ptr (with no cast) would generate the following compiler warning: drivers/auth/tbbr/tbbr_cot.c:826:14: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] REGISTER_COT(cot_desc); ^~~~~~~~ Change-Id: Iae62dd1bdb43fe379e3843d96461d47cc2f68a06 Signed-off-by: Sandrine Bailleux --- include/drivers/auth/auth_mod.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/drivers/auth/auth_mod.h b/include/drivers/auth/auth_mod.h index 39f5372e5..6c48124b5 100644 --- a/include/drivers/auth/auth_mod.h +++ b/include/drivers/auth/auth_mod.h @@ -40,11 +40,10 @@ int auth_mod_verify_img(unsigned int img_id, /* Macro to register a CoT defined as an array of auth_img_desc_t pointers */ #define REGISTER_COT(_cot) \ - const auth_img_desc_t **const cot_desc_ptr = \ - (const auth_img_desc_t **const)_cot; \ + const auth_img_desc_t *const *const cot_desc_ptr = (_cot); \ unsigned int auth_img_flags[MAX_NUMBER_IDS] -extern const auth_img_desc_t **const cot_desc_ptr; +extern const auth_img_desc_t *const *const cot_desc_ptr; extern unsigned int auth_img_flags[MAX_NUMBER_IDS]; #endif /* TRUSTED_BOARD_BOOT */ -- cgit v1.2.3