From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EE02C4361B for ; Wed, 9 Dec 2020 11:33:10 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 229CD235F7 for ; Wed, 9 Dec 2020 11:33:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 229CD235F7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=crapouillou.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:To: Subject:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bX7ccN8H4M4bL1jeMFUwewRUnusi2J/l/ddJl0wJUMo=; b=wrHkrXtArn82/OPgtwxQAwDRv SrTsdY1axdjI9V+xm/TEpb9ZYe3nxjvxRCDLn89IG5/i8kAnhdzW7JX1HEWIgvAasQ4Gvav23SBDn owrHHIJPlZ489fgVdTeB320hwAlkGjERJpLVKBNHkC18VLk9ueyMHOSUcMP5PSk94WSgfatkKwJ+9 wI3OjWznUUmQF6sGpyrjtkZU3M17MlPQvr/BGHNk+JyrZVMhqrHgf/pEVzWzEnb9BVk5wtWekVzf3 r1dywXwyrfwscEKf6yIN2KW+mTojQf7ZhWc0DLYgC/aSZmsUhJNjZPkVVw9Ifs5de/EKTommz/DUB IGznsKCQQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmxhO-000881-HP; Wed, 09 Dec 2020 11:31:58 +0000 Received: from aposti.net ([89.234.176.197]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmxhM-00087X-6F for linux-arm-kernel@lists.infradead.org; Wed, 09 Dec 2020 11:31:57 +0000 Date: Wed, 09 Dec 2020 11:31:41 +0000 From: Paul Cercueil Subject: Re: [PATCH 1/2] if_enabled.h: Add IF_ENABLED_OR_ELSE() =?UTF-8?Q?and=0D=0A?= IF_ENABLED() macros To: Linus Walleij Message-Id: In-Reply-To: References: <20201208164821.2686082-1-paul@crapouillou.net> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201209_063156_437111_B9ACF455 X-CRM114-Status: GOOD ( 12.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , od@zcrc.me, linux-mips@vger.kernel.org, Linux ARM , linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Linus, Le mer. 9 d=E9c. 2020 =E0 9:59, Linus Walleij = a =E9crit : > On Tue, Dec 8, 2020 at 5:48 PM Paul Cercueil = > wrote: > = >> Introduce a new header , that brings two new = >> macros: >> IF_ENABLED_OR_ELSE() and IF_ENABLED(). > = > I understand what the patch is trying to do, but when we already have > IS_ENABLED() in this syntax becomes a big cognitive > confusion for the mind. > = > At least the commit needs to explain why it doesn't work to use > IS_ENABLED() instead so that this is needed. You can use IS_ENABLED(). Then you'd write: field =3D IS_ENABLED(CONFIG_FOO) ? &my_ptr : NULL, the IF_ENABLED() macro makes it a bit cleaner by allowing you to write: field =3D IF_ENABLED(CONFIG_FOO, &my_ptr), Cheers, -Paul > Certainly the build failures must be possible to solve so that this > can live with the sibling IS_ENABLED() inside , > it can't be too hard. > = > Yours, > Linus Walleij _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel