From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752768AbbKPVfd (ORCPT ); Mon, 16 Nov 2015 16:35:33 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:51191 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752013AbbKPVf3 (ORCPT ); Mon, 16 Nov 2015 16:35:29 -0500 From: Arnd Bergmann To: Punit Agrawal Cc: Sudeep Holla , Jon Medhurst , Jassi Brar , Liviu Dudau , Lorenzo Pieralisi , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Subject: [PATCH] scpi: hide get_scpi_ops in module from built-in code Date: Mon, 16 Nov 2015 22:34:58 +0100 Message-ID: <4740279.aWlP1tqJLa@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:eYFac4Yg3iyd3Y6V5NLUSrOY9qSbtfd1rw6dm4tjJDrHKFQZx/a EXK84JHUTONx52qJp+BkDfl9lJuEa8VgxvSVrbJ0ItE0V+AOkC71WC3pen73BxVwrysXz16 cOezwppFbw1QflWhC74ZbNF2Lku5S1qBY3fVrYXEWYTeleKUYOYAvPIUoyUUCrfCraT+bcV 9hmS/VzCe28lfzJ6qZ+Vg== X-UI-Out-Filterresults: notjunk:1;V01:K0:Fw3kUQyasKM=:wDarv/zRJraYBMyateIf7i k1hCC7/RECWpJWcJqujTjSdEH63xF1CK048gGgjA5UtAH75hHZgMdw+IUjGaJxyGYooD98Ujs 6PpUYng5zKDUNnsBcXWOvuiMsVuUIXCxMBnj++TqHW8CqNDsrh1djsmQsfgxxB3SLYMh2S8e0 mxCPH2jpKxUFdLMoGZwsxEusBO62zFUu8NzWnSk5+y2YIVL7kBJPS2Y6dmh97uh+/76n+/Us/ 6uBGpKMqBVwcDd+64VJCxsYYLVF8Hsh6VFI2Xm13sTEoCswrysQlJOxSA/juUllEZOD0kXmsg CsJwA1JK7hy/y9tB8tuGncLKs+3OwqPoeH1E/Th0V/inVQ7bYHX5WsDte0habubhlSoriYs6p omrStaS8SnHBzfEdJvOU9+utW1/6lhm/wp/FmDUhwr3zR7OsH1DFpgZo7etuXKIdWqPBYB8Zf K/py+hwpERZ6CfiTPt89cK8/g1V9OnS7IWrct+2Zp1py+JuPKF2b/EvFPNl3nrop13n8zpRUn s15WeamA5M3JovbML4MSRj1qygp1kfkPnXOJB3FoxOWnGzC6tfAvd9HbUqhnSiiGvShYU/MFC TINsd/rICoPIrRVuAHMYbk5SNq1vXeCDdqfJW+dPNmoilYmL/kfTaLMhLwCdUYgOFEuvC3ODw eG4pdKUiPqap3u1wLrZN2FkNwS7DFzX4KdJZaKze5uvcRbIN9NIQSmHAtdNLJshgcgNduULN4 oSULwoV0g1r7PWYC Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The scpi_clock driver can be built-in when CONFIG_COMPILE_TEST is set even when ARM_SCPI_PROTOCOL is a loadable module, and that results in a link error: drivers/built-in.o: In function `scpi_clocks_probe': (.text+0x14453c): undefined reference to `get_scpi_ops' Using #if IS_REACHABLE() around the get_scpi_ops() declaration makes it build successfully in this case for compile-testing, but the effect is the same as when ARM_SCPI_PROTOCOL is disabled, as the code will not be used. Signed-off-by: Arnd Bergmann diff --git a/include/linux/scpi_protocol.h b/include/linux/scpi_protocol.h index 80af3cd35ae4..72ce932c69b2 100644 --- a/include/linux/scpi_protocol.h +++ b/include/linux/scpi_protocol.h @@ -71,7 +71,7 @@ struct scpi_ops { int (*sensor_get_value)(u16, u32 *); }; -#if IS_ENABLED(CONFIG_ARM_SCPI_PROTOCOL) +#if IS_REACHABLE(CONFIG_ARM_SCPI_PROTOCOL) struct scpi_ops *get_scpi_ops(void); #else static inline struct scpi_ops *get_scpi_ops(void) { return NULL; }