From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935187AbcI0TcX (ORCPT ); Tue, 27 Sep 2016 15:32:23 -0400 Received: from lb1-smtp-cloud2.xs4all.net ([194.109.24.21]:49319 "EHLO lb1-smtp-cloud2.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933759AbcI0TcO (ORCPT ); Tue, 27 Sep 2016 15:32:14 -0400 Message-ID: <1475004728.16606.8.camel@tiscali.nl> Subject: Re: [PATCH] CodingStyle: Expand IS_ENABLED() documentation From: Paul Bolle To: Bjorn Helgaas , Jonathan Corbet Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Date: Tue, 27 Sep 2016 21:32:08 +0200 In-Reply-To: <20160927190802.13636.10320.stgit@bhelgaas-glaptop2.roam.corp.google.com> References: <20160927190802.13636.10320.stgit@bhelgaas-glaptop2.roam.corp.google.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 On Tue, 2016-09-27 at 14:08 -0500, Bjorn Helgaas wrote: > --- a/Documentation/CodingStyle > +++ b/Documentation/CodingStyle > +Because the compiler processes the block, you have to use an #ifdef instead > +of IS_ENABLED() when code inside the block references symbols that will not > +exist if the condition is not met.  Different CONFIG_FOO autoconf.h symbols > +are generated for modular Kconfig options than for builtin ones, so you > +need "#if defined(CONFIG_FOO) || defined(CONFIG_FOO_MODULE)" Isn't that equivalent to "#if IS_ENABLED(CONFIG_FOO)"? > if FOO can be > +a module: > + > + .config include/generated/autoconf.h > + ------------ ---------------------------- > + CONFIG_FOO=y #define CONFIG_FOO 1 > + CONFIG_FOO=m #define CONFIG_FOO_MODULE 1 Paul Bolle