From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Date: Mon, 14 Dec 2015 12:02:27 +0000 Subject: Re: [PATCH] i2c: allow building emev2 without slave mode again Message-Id: <15285750.UWXWiNJ6YU@wuerfel> List-Id: References: <201512102224.cVm7Hcp0%fengguang.wu@intel.com> <2157023.1Ftpc9ZciN@wuerfel> <20151213090959.GB1570@katana> In-Reply-To: <20151213090959.GB1570@katana> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-arm-kernel@lists.infradead.org On Sunday 13 December 2015 10:09:59 Wolfram Sang wrote: > > What about not ifdeffing the inline function and keep the build error > whenever someone uses it without I2C_SLAVE being selected? The inline function is only added there for the case that I2C_SLAVE is disabled, so that would be pointless. However, what we could do is move the extern declaration outside of the #ifdef to make it always visible. The if(IS_ENABLED(CONFIG_I2C_SLAVE)) check should then ensure that it never actually gets called, and we get a link error if some driver gets it wrong. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752866AbbLNMDJ (ORCPT ); Mon, 14 Dec 2015 07:03:09 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:64467 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752740AbbLNMDF (ORCPT ); Mon, 14 Dec 2015 07:03:05 -0500 From: Arnd Bergmann To: Wolfram Sang Cc: kbuild test robot , kbuild-all@01.org, linux-i2c@vger.kernel.org, Niklas =?ISO-8859-1?Q?S=F6derlund?= , linux-sh@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] i2c: allow building emev2 without slave mode again Date: Mon, 14 Dec 2015 13:02:27 +0100 Message-ID: <15285750.UWXWiNJ6YU@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <20151213090959.GB1570@katana> References: <201512102224.cVm7Hcp0%fengguang.wu@intel.com> <2157023.1Ftpc9ZciN@wuerfel> <20151213090959.GB1570@katana> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:e5HFAHmn3czmaYnnZ9THIH6i1rvAtSkHlYe/rXjfdwkkbEyf0dp dcboxpYa32yHLj/uFLvai28JlrWKuw0F8ACQReB0rGEf88hvDgH5Gj6mJ31Omi+d4uRx/dc QgaBhmW3d+cEux8Pz5h+7kqNc+PEueeq870iMqrUhjizTEEgSNFt1GJPMMoJudYdBS8WbTX YHq1le0xupqesxPuXKRfw== X-UI-Out-Filterresults: notjunk:1;V01:K0:n7dEAUOjkh4=:8TxSk73xsDagnU0OMa+14z k3q7NdGcCVmywnnD7+eppSlSu6laacxaowarvgYVL5SuF8bwIrJYctu6BxYDRPmDgoyvRVbj1 ePDot75nt0UKuK2r2JxoMFHmHvqL4DE/yjptwOujb+OgFb3tpXutOwPUgLx15d56TdTdtXj63 AaITYxa4sXjDY9jlnj1OGirdhP6KsN/cicsafEfvwnwbjolfWeNr6kH5ZIeVl6a66RwAWWv6v WZOeBR1/n5Xr0Uul/UnYan7AY3U91t/gQvNJU2MO91hQuBCcd974dh5gj/N8OAUFkGuKpLm7V AAMRo03VaGf2m1uzhAUlP2yrZ2QuEIAQqAZ/iGV1wXAsDLzSQqExb+nOhXIVpUQlGfcUO3qVn xC+DoZ42RgRuwIt0Y3RSDIo4uDu9no8McMVvGq/bg+Tvnrr9uJt4R/soN8QXXs6xgW4mBx+Kc gUPpWaczIXNyLaFc61seSGmqvB1fxtNKSfxAjQhVFoSFR3Z4ujNtYB+XB+n4Jy6nJG7wOVRqM SFxAxSkgCGADDklDi64ANigl8JyJ2rRI6qNPNPXkgLviUKDKxfZvn8r19lT/YV1B7KxTb0l6H 8nCkpwJaUZSq2nF3yF2KYNAa436zUni/Clv5E4ISBwynUtiaeKDg06JhUmdBKKVGX2PTlri1R qY84kvcWPsKy4VCOxSi/LSIt3Y3kGr17iPOSEkS7wRt8fUZYI2qTvsfXSyYwi+ZZxZPDrrNyy w6S87P1NGZzFbaFO Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sunday 13 December 2015 10:09:59 Wolfram Sang wrote: > > What about not ifdeffing the inline function and keep the build error > whenever someone uses it without I2C_SLAVE being selected? The inline function is only added there for the case that I2C_SLAVE is disabled, so that would be pointless. However, what we could do is move the extern declaration outside of the #ifdef to make it always visible. The if(IS_ENABLED(CONFIG_I2C_SLAVE)) check should then ensure that it never actually gets called, and we get a link error if some driver gets it wrong. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: arnd@arndb.de (Arnd Bergmann) Date: Mon, 14 Dec 2015 13:02:27 +0100 Subject: [PATCH] i2c: allow building emev2 without slave mode again In-Reply-To: <20151213090959.GB1570@katana> References: <201512102224.cVm7Hcp0%fengguang.wu@intel.com> <2157023.1Ftpc9ZciN@wuerfel> <20151213090959.GB1570@katana> Message-ID: <15285750.UWXWiNJ6YU@wuerfel> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Sunday 13 December 2015 10:09:59 Wolfram Sang wrote: > > What about not ifdeffing the inline function and keep the build error > whenever someone uses it without I2C_SLAVE being selected? The inline function is only added there for the case that I2C_SLAVE is disabled, so that would be pointless. However, what we could do is move the extern declaration outside of the #ifdef to make it always visible. The if(IS_ENABLED(CONFIG_I2C_SLAVE)) check should then ensure that it never actually gets called, and we get a link error if some driver gets it wrong. Arnd