Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp43537imw; Wed, 13 Jul 2022 18:45:25 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v8UcqLWRYZEn0dZi3d/UgpJMjlxpGpszs+jTkTdpkJbuprA99Cx8j/HT4FTgQCnOGnmaB3 X-Received: by 2002:a17:902:6b07:b0:16b:f220:92fb with SMTP id o7-20020a1709026b0700b0016bf22092fbmr6409964plk.96.1657763124795; Wed, 13 Jul 2022 18:45:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657763124; cv=none; d=google.com; s=arc-20160816; b=zKPQafRaG0NlPmVffBLzVwRa6UA45p2ymjW1DEOE8qwXQvYuZQ3gXefnrQuiljutmH Vfu9h+HZPTIIrnCN/sVRqquOKzpAy5vPKPHgufmrfT921xRFDXptt6iNfJTO35vA44xC XDePc5x/08xdSksuZOX3kjc413JMkxr9+0Y+ntd9H5bycQMvqPqDXOuzAYqe0GhD1Kyl hbmtxykf2fUs34qEMl478XKM5g+JhEMQvfLyR/+5GXOh/5lW5Ew70XXPsbbD2avFs0cw n2fZdNImKwwoxglmdLHgvL0TJ/WyZuIwIWXHiFKDScqpwPNKtmxAvARpkpczeKQaiOFR T5pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=UqrddPa7B1xjzhJhO0J8la6bxwPd05VQ0KH+5kAgy7k=; b=n7o8luzGzSsjOj25X6Y7PLDsc+bvZgZXKi0g034rNG6L+iMxYn2lDInivPKVJRPXfm Hc8+Z6FkqDaD1CDADJi293guMRVgYFtoFKZ2V5gtdFUA+4RzIdpBXmQ5xrb69JYEKGym Y7cekVR3cphzHn+j0hjXi8RZbaiwgne9ICskWGinmm2GwGIffcGOh5k/ZAt2D2nu8wYV 9Mqo7x6gqjwbaSXqF/HZOVSuNJM3V7M4IZxfUdeWcA8ReflyqtcAE1eviAAhvk3KsFAB VsWlu65fYyx/IdXAcygzN8Fzhqc2jUgbJ7WOPXSAgl0SJgUq73WHXeYchMN2HSOa3f4d 4FgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Gg6hPige; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l64-20020a639143000000b0040de5538373si160524pge.28.2022.07.13.18.45.12; Wed, 13 Jul 2022 18:45:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Gg6hPige; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231473AbiGNBIi (ORCPT + 99 others); Wed, 13 Jul 2022 21:08:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231490AbiGNBIf (ORCPT ); Wed, 13 Jul 2022 21:08:35 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05E6CDFF; Wed, 13 Jul 2022 18:08:33 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id o5-20020a17090a3d4500b001ef76490983so882446pjf.2; Wed, 13 Jul 2022 18:08:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=UqrddPa7B1xjzhJhO0J8la6bxwPd05VQ0KH+5kAgy7k=; b=Gg6hPigeI28/Nz8Tgupc1gPKfxBuZE/HW3NjdQdE5rxwDE7Pd2F4ZHtbf4aGTXE7oI qe0B7x9kgHxYqAqO0r1UCG1BVbe4QbBHExm3bbBQfF3JlaoYvhILVQkhuSJ0J7403uCe q++65HSXvRbliZLG7McB4VpNl1YDJ+kwtQR4RqbvQQca4249BZ1EL4zyN93dNZEWkvyu bwvdDNmAw5aUckdZjzwgtMpXt/76X+Li7P969Cu2Z3fEdOlry9RvF46NVmX8T9X2o0UY E/AS+c1WHLf/19v9Vvdu0fy6Zq6tBzG4Zz19ackdtjvm/aJKbxPrIqYseBQnnSRR65GM crrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=UqrddPa7B1xjzhJhO0J8la6bxwPd05VQ0KH+5kAgy7k=; b=xCx9VNHO1ddyR6vUxiciHIsqepC/MGRIH6WEJJKlQkYN5APa3DFDbz4zLlK8/ogFo3 pO3cC5isypM+JdzK7kvF0lLTUah8RV6AzY3nHxd9HVbpDjx7eLrL0n6PPRev/Yx3FRZr rW3Uf2Qe/u8nw6xV6RTVZzSyLvcSWS1955S9XZgS11GkLffoc5iHwPOVq+6lj6/QrwIL aaahJ1b5dDrelJ6dR92JiGFnDDN6btCeL8TnubE2+ol2cZz2MPPDgFkAOldvcDRyxQHD j8t9A4PGEi0sagYZFqq/z/6kmP4H3i/voY0Xk8/iCKkGPiLfluWI3m3S92IkLDWKrbfL vjgQ== X-Gm-Message-State: AJIora+ZHzf4C6O3QitA8mTNEPipRDAQesiY+eNylPDpzBlQuQkI4+vY QJFM+Pl6riDlMvR4qmKWsdk= X-Received: by 2002:a17:902:f606:b0:168:ecca:44e with SMTP id n6-20020a170902f60600b00168ecca044emr5661281plg.144.1657760913366; Wed, 13 Jul 2022 18:08:33 -0700 (PDT) Received: from sol (110-174-58-111.static.tpgi.com.au. [110.174.58.111]) by smtp.gmail.com with ESMTPSA id v6-20020a1709029a0600b0016be834d54asm38983plp.306.2022.07.13.18.08.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jul 2022 18:08:32 -0700 (PDT) Date: Thu, 14 Jul 2022 09:08:27 +0800 From: Kent Gibson To: Andy Shevchenko Cc: Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , Bartosz Golaszewski , Linus Walleij , Dipen Patel Subject: Re: [PATCH 6/6] gpiolib: cdev: compile out HTE unless CONFIG_HTE selected Message-ID: <20220714010827.GA45880@sol> References: <20220713013721.68879-1-warthog618@gmail.com> <20220713013721.68879-7-warthog618@gmail.com> <20220713103014.GC113115@sol> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220713103014.GC113115@sol> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 13, 2022 at 06:30:14PM +0800, Kent Gibson wrote: > On Wed, Jul 13, 2022 at 12:03:07PM +0200, Andy Shevchenko wrote: > > On Wed, Jul 13, 2022 at 3:39 AM Kent Gibson wrote: > > > > > > The majority of builds do not include HTE, so compile out hte > > > functionality unless CONFIG_HTE is selected. > > > > ... > > > > > +#ifdef CONFIG_HTE > > > /* > > > * -- hte specific fields -- > > > */ > > > > Now this comment seems useless to me and it takes 3 LoCs. > > > > ... > > > > > + else if (IS_ENABLED(CONFIG_HTE) && > > > + (test_bit(FLAG_EVENT_CLOCK_HTE, &line->desc->flags))) > > > > Too many parentheses. > > > > ... > > > > > + if (!IS_ENABLED(CONFIG_HTE) || > > > + !test_bit(FLAG_EVENT_CLOCK_HTE, &line->desc->flags)) { > > > > if (!(x && y)) ? > > > > ... > > > > > + if (!IS_ENABLED(CONFIG_HTE) && > > > + (flags & GPIO_V2_LINE_FLAG_EVENT_CLOCK_HTE)) > > > + return -EOPNOTSUPP; > > > > Ditto for consistency? > > On second thought, that last one becomes: if (!(IS_ENABLED(CONFIG_HTE) || !(flags & GPIO_V2_LINE_FLAG_EVENT_CLOCK_HTE)) return -EOPNOTSUPP; which is MUCH less readable, so I'll leave that one as is. Cheers, Kent.