Re: [PATCH] EDAC, pnd2_edac: fix build error without CONFIG_EDAC_DEBUG

From: Borislav Petkov
Date: Thu Mar 23 2017 - 11:27:55 EST


On Thu, Mar 23, 2017 at 04:16:35PM +0100, Arnd Bergmann wrote:
> Calling into functions inside of the #ifdef causes an obvious compile error:
>
> drivers/edac/pnd2_edac.c: In function 'pnd2_init':
> drivers/edac/pnd2_edac.c:1521:2: error: implicit declaration of function 'setup_pnd2_debug'; did you mean 'setup_log_buf'? [-Werror=implicit-function-declaration]
> drivers/edac/pnd2_edac.c: In function 'pnd2_exit':
> drivers/edac/pnd2_edac.c:1529:2: error: implicit declaration of function 'teardown_pnd2_debug' [-Werror=implicit-function-declaration]
>
> This removes the #ifdef and instead uses an equivalent IS_ENABLED() check
> so the compiler can silently drop the functions but still build-test them
> and not need an #ifdef.
>
> Fixes: 5c71ad17f97e ("EDAC, pnd2_edac: Add new EDAC driver for Intel SoC platforms")
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
> ---
> drivers/edac/pnd2_edac.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)

Thanks Arnd, I'm already running randconfig builds on the fixes:

https://lkml.kernel.org/r/20170322172923.GA15888@xxxxxxxxxxx

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.