From patchwork Fri Jul 1 15:13:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9210017 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D53D660752 for ; Fri, 1 Jul 2016 15:12:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C623428699 for ; Fri, 1 Jul 2016 15:12:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA88B286A7; Fri, 1 Jul 2016 15:12:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C1D8286A4 for ; Fri, 1 Jul 2016 15:12:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752134AbcGAPMO (ORCPT ); Fri, 1 Jul 2016 11:12:14 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:64412 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751280AbcGAPL4 (ORCPT ); Fri, 1 Jul 2016 11:11:56 -0400 Received: from wuerfel.localnet ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue001) with ESMTPSA (Nemesis) id 0MWsiR-1aqF741hed-00Xul6; Fri, 01 Jul 2016 17:11:05 +0200 From: Arnd Bergmann To: Hans Verkuil Cc: Hans Verkuil , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] [media] cec: add missing inline stubs Date: Fri, 01 Jul 2016 17:13:55 +0200 Message-ID: <6419506.V8JtZUoqT3@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-22-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <51b68698-eced-a659-016f-cf9566851fd2@xs4all.nl> References: <20160701112027.102024-1-arnd@arndb.de> <51b68698-eced-a659-016f-cf9566851fd2@xs4all.nl> MIME-Version: 1.0 X-Provags-ID: V03:K0:tT5QEO3Wz3ZRD9DcEjzi8GHxUiKzuUtPle16s8Zuk2X/9yLZ+1L actJpxHWSoNxJrxgAvF4Gq8YGd1S747k+DtQllwQ8NaDROkJh2FJHdfmxER+SL+ax5rP+yh itvubYfxzKLMo51aS/46L9XNnm9A/jF+tqDqtrmiqQfeiEpMoV4BFO+yvzMA/PIv+UDboPW FXGsf6gAozkPqrRVe0XNQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:B2MkJ0btuk4=:81cl6P6tTXIOvbwYfIslle aZwQq0tBCLgI/iuzSm5uV3zT5pA78sSsrGptjDfLK0usTBHsqmOsB3KIEQtaLW8zKkyvo1fI5 avglhD91Gfx4w1RnQcBDQeNA1F5S1sI6Xnjxsjjgzb30E7QlcOYQJHYztwN8qGDMHrJdeuFOV 9Lo+VPeaBqcPLMrbyHyoWuKVNOcS6k2CMlCBCXAGfglm4ahXWauf0iNaPqtSdgLv14DI7hHft /uVPgYx47T4o6MhkS+BRTNUiZ6jj+aS+3s0sw5abfB4x8UWP83Apg1h/eZjyftFOTX7Z3sVMS TfLcYm4t+mIG0iJBxFBrcHy+GaMjrXpGMlsxW6642W7qoV2neQGeg1DHfRG/CnZLDHLSfoVdi u8ZvOvUbyjgt03jrQHZW3j92C2BC/vjok7f0J8LMD/uKNPcYl1Qi0XTiaHnr4gsxxzXlwmS7K JbAAsQioL+kmTrRWP2wIyDKTqFUNbm7w8+2/pnA8AojLK5gpoi1GG1PqeBhJBZwrXLIIWotfw 3LYCA1mb5XJver4Zvr4tfhww8gm4jnNnHct/TsEZ1N5vLFvD6xuH8+mJM/DIbpPHzBZGQlP8H UZ4Pau/wZDNB56vGXqjX7haGL0H2NXdVYmcZ1s02MFI8eNmGtiCFmyqRde+g3G1DxbHnt+Au0 1iznyOos8a4qaEynmEyPoBHgP6bg06GbyQlzxib/MC4EejCa3GVqXRwH3XtQC7wrarznAM2Jo K7wJwvOt4rCUvg4j Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Friday, July 1, 2016 4:35:09 PM CEST Hans Verkuil wrote: > On 07/01/2016 01:19 PM, Arnd Bergmann wrote: > > The linux/cec.h header file contains empty inline definitions for > > a subset of the API for the case in which CEC is not enabled, > > however we have driver that call other functions as well: > > > > drivers/media/i2c/adv7604.c: In function 'adv76xx_cec_tx_raw_status': > > drivers/media/i2c/adv7604.c:1956:3: error: implicit declaration of function 'cec_transmit_done' [-Werror=implicit-function-declaration] > > drivers/media/i2c/adv7604.c: In function 'adv76xx_cec_isr': > > drivers/media/i2c/adv7604.c:2012:4: error: implicit declaration of function 'cec_received_msg' [-Werror=implicit-function-declaration] > > drivers/media/i2c/adv7604.c: In function 'adv76xx_probe': > > drivers/media/i2c/adv7604.c:3482:20: error: implicit declaration of function 'cec_allocate_adapter' [-Werror=implicit-function-declaration] > > I don't understand this. These calls are under #if IS_ENABLED(CONFIG_VIDEO_ADV7842_CEC), > and that should be 0 if MEDIA_CEC is not selected. > > Am I missing some weird config combination? This must have been a build error I ran into before your patch, when I had this one applied locally instead: which is still not overly nice, but it manages to avoid the IS_REACHABLE() check and it lets MEDIA_CEC be a module. Arnd --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/media/cec.h b/include/media/cec.h index c462f9b44074..564a6a06bed7 100644 --- a/include/media/cec.h +++ b/include/media/cec.h @@ -187,7 +187,7 @@ static inline bool cec_is_sink(const struct cec_adapter *adap) return adap->phys_addr == 0; } -#if IS_ENABLED(CONFIG_MEDIA_CEC) +#if IS_REACHABLE(CONFIG_MEDIA_CEC) struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops, void *priv, const char *name, u32 caps, u8 available_las, struct device *parent); because that was hiding the declarations when the code could not reach it. With your newer patch that is not possible any more. I also wasn't aware that each of these already had their own Kconfig symbols. Could we just do this instead of your patch then: diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig index ce9006e10a30..73e047220905 100644 --- a/drivers/media/i2c/Kconfig +++ b/drivers/media/i2c/Kconfig @@ -222,6 +222,7 @@ config VIDEO_ADV7604 config VIDEO_ADV7604_CEC bool "Enable Analog Devices ADV7604 CEC support" depends on VIDEO_ADV7604 && MEDIA_CEC + depends on VIDEO_ADV7604=m || MEDIA_CEC=y ---help--- When selected the adv7604 will support the optional HDMI CEC feature. @@ -243,6 +244,7 @@ config VIDEO_ADV7842 config VIDEO_ADV7842_CEC bool "Enable Analog Devices ADV7842 CEC support" depends on VIDEO_ADV7842 && MEDIA_CEC + depends on VIDEO_ADV7842=m || MEDIA_CEC=y ---help--- When selected the adv7842 will support the optional HDMI CEC feature. @@ -475,6 +477,7 @@ config VIDEO_ADV7511 config VIDEO_ADV7511_CEC bool "Enable Analog Devices ADV7511 CEC support" depends on VIDEO_ADV7511 && MEDIA_CEC + depends on VIDEO_ADV7511=m || MEDIA_CEC=y ---help--- When selected the adv7511 will support the optional HDMI CEC feature. diff --git a/drivers/media/platform/vivid/Kconfig b/drivers/media/platform/vivid/Kconfig index 8e6918c5c87c..8e31146d079a 100644 --- a/drivers/media/platform/vivid/Kconfig +++ b/drivers/media/platform/vivid/Kconfig @@ -26,6 +26,7 @@ config VIDEO_VIVID config VIDEO_VIVID_CEC bool "Enable CEC emulation support" depends on VIDEO_VIVID && MEDIA_CEC + depends on VIDEO_VIVID=m || MEDIA_CEC=y ---help--- When selected the vivid module will emulate the optional HDMI CEC feature.