From efc4ad0bc763f135f3437f51df693e83941a9928 Mon Sep 17 00:00:00 2001 From: Alexandru Gagniuc Date: Wed, 20 Jan 2021 10:46:49 -0600 Subject: spl: fit: Drop 'length' argument to board_spl_fit_post_load() The size is derived from the FIT image itself. Any alignment requirements are machine-specific and known by the board code. Thus the total length can be derived from the FIT image and knowledge of the platform. The 'length' argument is redundant. Remove it. Signed-off-by: Alexandru Gagniuc Reviewed-by: Peng Fan Reviewed-by: Simon Glass CC: Matt Porter --- include/spl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/spl.h b/include/spl.h index e172500b5f8..0d134587de2 100644 --- a/include/spl.h +++ b/include/spl.h @@ -701,9 +701,9 @@ int board_return_to_bootrom(struct spl_image_info *spl_image, /** * board_spl_fit_post_load - allow process images after loading finished - * + * @fit: Pointer to a valid Flattened Image Tree blob */ -void board_spl_fit_post_load(ulong load_addr, size_t length); +void board_spl_fit_post_load(const void *fit); /** * board_spl_fit_size_align - specific size align before processing payload -- cgit v1.2.3 From 9e304239785dce3100303bf3dc211cf544247da0 Mon Sep 17 00:00:00 2001 From: Alexandru Gagniuc Date: Wed, 20 Jan 2021 10:46:54 -0600 Subject: image: Do not #if guard board_fit_image_post_process() prototype There's no point in guarding function prototypes with #ifdefs. If a function is not defined, the linker will notice. Having the prototype does not affect code size. What the #if guard takes away is the ability to use IS_ENABLED: if (CONFIG_IS ENABLED(FIT_IMAGE_POST_PROCESS)) board_fit_image_post_process(...) When the prototype is guarded, the above form cannot be used. This leads to the proliferation of #ifdefs, and unreadable code. The opportunity cost of the #if guard outweighs any benefits. Remove it. Since the original version of this patch, an empty definition was added by commit f14e6eec6c7f ("image: cleanup pre-processor usage"). The empty definition can cause silent failures, when an implementation of board_fit_image_post_process() is expected because the linker will not catch the missing function. Thus this patch removes this empty inline declaration. Fixes: f14e6eec6c7f ("image: cleanup pre-processor usage") Signed-off-by: Alexandru Gagniuc Reviewed-by: Simon Glass --- include/image.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'include') diff --git a/include/image.h b/include/image.h index d5a940313a6..138c83dd28d 100644 --- a/include/image.h +++ b/include/image.h @@ -1556,8 +1556,6 @@ bool android_image_print_dtb_contents(ulong hdr_addr); */ int board_fit_config_name_match(const char *name); -#if defined(CONFIG_SPL_FIT_IMAGE_POST_PROCESS) || \ - defined(CONFIG_FIT_IMAGE_POST_PROCESS) /** * board_fit_image_post_process() - Do any post-process on FIT binary data * @@ -1572,11 +1570,6 @@ int board_fit_config_name_match(const char *name); * @return no return value (failure should be handled internally) */ void board_fit_image_post_process(void **p_image, size_t *p_size); -#else -static inline void board_fit_image_post_process(void **p_image, size_t *p_size) -{ -} -#endif /* CONFIG_SPL_FIT_IMAGE_POST_PROCESS */ #define FDT_ERROR ((ulong)(-1)) -- cgit v1.2.3