Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754858AbcJTKFD (ORCPT ); Thu, 20 Oct 2016 06:05:03 -0400 Received: from lb2-smtp-cloud3.xs4all.net ([194.109.24.26]:45372 "EHLO lb2-smtp-cloud3.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750946AbcJTKFA (ORCPT ); Thu, 20 Oct 2016 06:05:00 -0400 Message-ID: <1476957892.28989.24.camel@tiscali.nl> Subject: Re: [PATCH] kconfig.h: remove config_enabled() macro From: Paul Bolle To: Masahiro Yamada , Andrew Morton Cc: linux-arch@vger.kernel.org, Peter Oberparleiter , Arnd Bergmann , Kees Cook , Michal Marek , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Thomas Garnier Date: Thu, 20 Oct 2016 12:04:52 +0200 In-Reply-To: <1476616078-32252-1-git-send-email-yamada.masahiro@socionext.com> References: <1476616078-32252-1-git-send-email-yamada.masahiro@socionext.com> 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: 1895 Lines: 54 Masahiro, A few comments regarding, I guess, future work. On Sun, 2016-10-16 at 20:07 +0900, Masahiro Yamada wrote: > The use of config_enabled() is ambiguous.  For config options, > IS_ENABLED(), IS_REACHABLE(), etc. will make intention clearer. > Sometimes config_enabled() has been used for non-config options > because it is useful to check whether the given symbol is defined > or not. > > I have been tackling on deprecating config_enabled(), and now is the > time to finish this work. > > Some new users have appeared for v4.9-rc1, but it is trivial to > replace them: > >  - arch/x86/mm/kaslr.c >   replace config_enabled() with IS_ENABLED() because >   CONFIG_X86_ESPFIX64 and CONFIG_EFI are boolean. > >  - include/asm-generic/export.h >   replace config_enabled() with __is_defined(). > > Then, config_enabled() can be removed now. > > Going forward, please use IS_ENABLED(), IS_REACHABLE(), etc. for > config options, and __is_defined() for non-config symbols. 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?  > Signed-off-by: Masahiro Yamada > --- 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? >  #define __is_defined(x) ___is_defined(x) > #define ___is_defined(val) ____is_defined(__ARG_PLACEHOLDER_##val) > #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? Paul Bolle