[PATCH 6/8] image: Do not #if guard board_fit_config_name_match() prototype

Simon Glass
2020-12-19T02:29:05Z

Hi Alexandru

On Tue, 15 Dec 2020 at 17:10, Alexandru Gagniuc <mr.nuke.me@gmail.com> wrote:
>
> 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_config_name_match(...)
>
> 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.
>
> Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
> ---
> include/image.h | 3 ---
> 1 file changed, 3 deletions(-)

Yes indeed.

Reviewed-by: Simon Glass <sjg@chromium.org>