Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935120AbcJTMoU (ORCPT ); Thu, 20 Oct 2016 08:44:20 -0400 Received: from lb2-smtp-cloud3.xs4all.net ([194.109.24.26]:59551 "EHLO lb2-smtp-cloud3.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933777AbcJTMoJ (ORCPT ); Thu, 20 Oct 2016 08:44:09 -0400 Message-ID: <1476967442.28989.38.camel@tiscali.nl> Subject: Re: [PATCH] kconfig.h: remove config_enabled() macro From: Paul Bolle To: Masahiro Yamada Cc: Nicolas Pitre , Andrew Morton , linux-arch@vger.kernel.org, Peter Oberparleiter , Arnd Bergmann , Kees Cook , Michal Marek , X86 ML , "H. Peter Anvin" , Linux Kernel Mailing List , Thomas Gleixner , Ingo Molnar , Thomas Garnier Date: Thu, 20 Oct 2016 14:44:02 +0200 In-Reply-To: References: <1476616078-32252-1-git-send-email-yamada.masahiro@socionext.com> <1476957892.28989.24.camel@tiscali.nl> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2243 Lines: 65 [Added Nicolas.] On Thu, 2016-10-20 at 21:06 +0900, Masahiro Yamada wrote: > 2016-10-20 19:04 GMT+09:00 Paul Bolle : > > On Sun, 2016-10-16 at 20:07 +0900, Masahiro Yamada wrote: > > There are about a dozen instances of IS_ENABLED() that target something > > other than a kconfig macros. Are you planning to convert those to > > __is_defined() too? > > I did not notice that, but looks like there are some to be checked. Are you willing to do that or should I give it a try (after this patch has landed, of course)? > > > --- a/include/linux/kconfig.h > > > +++ b/include/linux/kconfig.h > > > @@ -31,7 +31,6 @@ > > >   * When CONFIG_BOOGER is not defined, we generate a (... 1, 0) pair, and when > > >   * the last step cherry picks the 2nd arg, we get a zero. > > >   */ > > > -#define config_enabled(cfg)          ___is_defined(cfg) > > > > Is there a reason to keep using the double underscore prefix? > > I followed the suggestion in the following message: > > https://lkml.org/lkml/2016/6/6/944 Nicolas: was there any specific reason to suggest __is_defined() and not, say, is_defined()? > > >  #define __is_defined(x)                      ___is_defined(x) > > >  #define > > > ___is_defined(val)           ____is_defined(__ARG_PLACEHOLDER_##v > > > al) > > >  #define ____is_defined(arg1_or_junk) > > > __take_second_arg(arg1_or_junk 1, 0) > > > > __is_defined() is now meant to be used generally, and not just on > > kconfig macros. Can it be moved into another header? > > Currently, __is_defined() is only used in two places: > > include/linux/export.h > include/asm-generic/export.h > > Even if we fix something like IS_ENABLED(DEBUG), > we do not have many for now, > but perhaps will it be used more widely in the future? > > If so, do we need to add  IS_DEFINED() or is_defined()? Either is fine with me. I'll gladly defer to anyone with good taste in naming things. > in include/linux/kconfig.h ?  or include/linux/kernel.h ? kernel.h seems to be included just about anywhere and it contains various preprocessor macros of general utility. So that looks like a fine candidate. Would it be a problem to put it there? Thanks, Paul Bolle