From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935181AbdCWPRW (ORCPT ); Thu, 23 Mar 2017 11:17:22 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:61228 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933890AbdCWPRU (ORCPT ); Thu, 23 Mar 2017 11:17:20 -0400 From: Arnd Bergmann To: Tony Luck , Borislav Petkov , Mauro Carvalho Chehab Cc: Arnd Bergmann , Qiuxu Zhuo , linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] EDAC, pnd2_edac: fix build error without CONFIG_EDAC_DEBUG Date: Thu, 23 Mar 2017 16:16:35 +0100 Message-Id: <20170323151649.658800-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:ZKQG9t+OdIEqNeQEJi4bTM+4Sbv3rzJgc2jra/atw3IIbGbp0hN QVvFUDGY1UUDD11FhUbpRctVb6ahwZJejta6QSYqK7p1GGO7nN63Oh7nTeEAG4LetEZJ/nT efVG4fTi9o0bux0EQ6Eil/Htcyesp2qXsw70KaPTyy+HcyYIHRxEfkZUsN8ekvs4ZIfV3gE GGwZ2s4/qgE8cdTc6e3Aw== X-UI-Out-Filterresults: notjunk:1;V01:K0:82jePryL3gc=:AQUJoh5Jz1i85/erOry4Tk 3hv3WmZ4u5dnqjnsC9TqXJFdu5ncm+zGIhAsjRfCO1YxP72HJBzUHKjbK4+SQz1nnNj/Z0f9k OTJzOAqBlAoFlyt1eYTwgqJd7HyXUtQegoDK2OCBX/o51eSY0APjbCnpL9oWfbU8PN5LbZH0G KgqguoDTfJxHeIi1NSQ4NNo4hT+90/Vc64yj2FmhUd/hdQDEdRJB/20zaRMS+qwp3Fr+tSp6V UUhP5x7AfUPTkAJ+81JwiR47iHYMcJQk/2PK+pUUAeMv1cTfSMhuGoa1xpW0C+IHVx0aNJd+o XIOS6MYSmiynLVS+fKxo55MjrzcCuz/7LPctwDQ0henl4ufktIfEMqrflzThHPkaxZBG632JO H7DMCb8otVcMAYo7fUGqLGTo3Uab3LB1BoaAJGDaKspy4bKH6u+uO41NdVLqgXgki3Ss2PII2 QEOBYE9gvNMZ/ZCId0wa/ZtB7b/edU5kgTttZkqOQPYNUWhl5xMLRSr+UI9Int3IBU4dgIDYp DTHb6e4XYGHWBeAdf34OARJBCL7YvfRTX9mFPYUJkEQbD1k1ZM7fiZYeWAb/w22v/zTl+Q7+S Hz9SweOfjSKInnKSdYXeiJYCgGSNyIkHwXTPoN75tTsiUx/1SKKjcA9c3CsEgotOoRJR4/IM5 IY455WrzArrmI8wYnNORBJFzGs3PNIWJbhN1NCtCKtpiUB8Qe4sw9CF0vSaHV0m3cIqI= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/edac/pnd2_edac.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/edac/pnd2_edac.c b/drivers/edac/pnd2_edac.c index 14d39f05226e..25693a4c14c3 100644 --- a/drivers/edac/pnd2_edac.c +++ b/drivers/edac/pnd2_edac.c @@ -1389,7 +1389,6 @@ static struct notifier_block pnd2_mce_dec = { .notifier_call = pnd2_mce_check_error, }; -#ifdef CONFIG_EDAC_DEBUG /* * Write an address to this file to exercise the address decode * logic in this driver. @@ -1435,7 +1434,6 @@ static void teardown_pnd2_debug(void) { debugfs_remove_recursive(pnd2_test); } -#endif static int pnd2_probe(void) { @@ -1518,7 +1516,8 @@ static int __init pnd2_init(void) return -ENODEV; mce_register_decode_chain(&pnd2_mce_dec); - setup_pnd2_debug(); + if (IS_ENABLED(CONFIG_EDAC_DEBUG)) + setup_pnd2_debug(); return 0; } @@ -1526,7 +1525,8 @@ static int __init pnd2_init(void) static void __exit pnd2_exit(void) { edac_dbg(2, "\n"); - teardown_pnd2_debug(); + if (IS_ENABLED(CONFIG_EDAC_DEBUG)) + teardown_pnd2_debug(); mce_unregister_decode_chain(&pnd2_mce_dec); pnd2_remove(); } -- 2.9.0