Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754516AbbBZVX7 (ORCPT ); Thu, 26 Feb 2015 16:23:59 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:59037 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753943AbbBZVX6 (ORCPT ); Thu, 26 Feb 2015 16:23:58 -0500 Date: Thu, 26 Feb 2015 13:23:57 -0800 From: Andrew Morton To: monstr@monstr.eu Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] kconfig: Use macros which are already defined Message-Id: <20150226132357.ee76e28ad029463e582183d8@linux-foundation.org> In-Reply-To: <54EAFF92.5070709@monstr.eu> References: <54EAFF92.5070709@monstr.eu> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2565 Lines: 82 On Mon, 23 Feb 2015 11:23:14 +0100 Michal Simek wrote: > Hi Andrew, > > On 12/11/2014 10:00 AM, Michal Simek wrote: > > It is better to use macros which are already available > > because then there is just one location which needs to be change. > > > > Signed-off-by: Michal Simek > > --- > > > > FYI: Fengguang's testing system doesn't show any build error. > > --- > > include/linux/kconfig.h | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h > > index be342b94c640..71acdf650e2e 100644 > > --- a/include/linux/kconfig.h > > +++ b/include/linux/kconfig.h > > @@ -28,7 +28,7 @@ > > * > > */ > > #define IS_ENABLED(option) \ > > - (config_enabled(option) || config_enabled(option##_MODULE)) > > + (IS_BUILTIN(option) || IS_MODULE(option)) > > > > /* > > * IS_BUILTIN(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', 0 > > -- > > 1.8.2.3 > > > I can't find the original email anywhere, hrm. As I received it, this patch is From:monstr@monstr.eu and Signed-off-by:michal.simek@xilinx.com, which is unusual. Probably you should be adding explicit From: lines to the patch changelogs to override this. After the patch, IS_ENABLED is defined before the macros which it uses. That's not an error (unless someone puts an inlined function in there before the IS_BUILTIN or IS_MODULE definitions), but it's unusual, unexpected and illogical. So, --- a/include/linux/kconfig.h~kconfig-use-macros-which-are-already-defined-fix +++ a/include/linux/kconfig.h @@ -23,14 +23,6 @@ #define ___config_enabled(__ignored, val, ...) val /* - * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm', - * 0 otherwise. - * - */ -#define IS_ENABLED(option) \ - (IS_BUILTIN(option) || IS_MODULE(option)) - -/* * IS_BUILTIN(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', 0 * otherwise. For boolean options, this is equivalent to * IS_ENABLED(CONFIG_FOO). @@ -43,4 +35,11 @@ */ #define IS_MODULE(option) config_enabled(option##_MODULE) +/* + * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm', + * 0 otherwise. + */ +#define IS_ENABLED(option) \ + (IS_BUILTIN(option) || IS_MODULE(option)) + #endif /* __LINUX_KCONFIG_H */ _ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/