Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D503AC6FD1D for ; Tue, 21 Mar 2023 15:58:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231379AbjCUP6s (ORCPT ); Tue, 21 Mar 2023 11:58:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229744AbjCUP6q (ORCPT ); Tue, 21 Mar 2023 11:58:46 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3914010A8D; Tue, 21 Mar 2023 08:58:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=URL1tZO+Mirs0erydKMklYrp3ZSfkDqzdADLJvizp6w=; b=6O7pbXHfrDLF1ERdKmcEt4/wro CWPWCweOhhbqISBnDZYDjlM9/2ETuYnwCYE6KeGvbwKEi8GamEsBa8qyrD1gVIb6Q184e92b1noDZ viurRXe3X38vQUeoz2nv+b7oD4Gt/tEjp4su8bZwanLZprQygZpFo48rLfs8OCZCWQvw=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1peeNR-007yuF-79; Tue, 21 Mar 2023 16:58:21 +0100 Date: Tue, 21 Mar 2023 16:58:21 +0100 From: Andrew Lunn To: Christian Marangi Cc: Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Heiner Kallweit , Russell King , Gregory Clement , Sebastian Hesselbarth , Andy Gross , Bjorn Andersson , Konrad Dybcio , Pavel Machek , Lee Jones , John Crispin , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-leds@vger.kernel.org Subject: Re: [net-next PATCH v5 04/15] leds: Provide stubs for when CLASS_LED is disabled Message-ID: <32202a37-270f-4503-9147-55aa2615116a@lunn.ch> References: <20230319191814.22067-1-ansuelsmth@gmail.com> <20230319191814.22067-5-ansuelsmth@gmail.com> <64189d72.190a0220.8d965.4a1c@mx.google.com> <5ee3c2cf-8100-4f35-a2df-b379846a8736@lunn.ch> <6419c60e.df0a0220.1949a.c432@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6419c60e.df0a0220.1949a.c432@mx.google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Also why IS_ENABLED instead of a simple ifdef? (in leds.h there is a mix > of both so I wonder if we should use one or the other) /* * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm', * 0 otherwise. Note that CONFIG_FOO=y results in "#define CONFIG_FOO 1" in * autoconf.h, while CONFIG_FOO=m results in "#define CONFIG_FOO_MODULE 1". */ #define IS_ENABLED(option) __or(IS_BUILTIN(option), IS_MODULE(option)) It cleanly handles the module case, which i guess most people would get wrong. Andrew