Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1819778rwn; Fri, 16 Sep 2022 00:58:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6GauYpqN5XNiKri5TgMvzrilh3nhzjgntvqPNHTGUfEBBw0YtMpKa9mMCQjpWgp+xzJlf9 X-Received: by 2002:a17:903:2443:b0:178:221d:c599 with SMTP id l3-20020a170903244300b00178221dc599mr3710553pls.100.1663315105740; Fri, 16 Sep 2022 00:58:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663315105; cv=none; d=google.com; s=arc-20160816; b=dyrXzu28WEuKmwD/00k51OOHVx+Hoo+UAsV8AcojQlcyv4W8ynMjjXgRIADxoAiMEF fxVCD6ZRMb001F5KYo+LeDWpVU4qdzTFHUWlZBDTXDEnYa1rNbJqvsCgdLVqeIVdH6zc CgdR5Ne3eiIQzWzH2tTrzy8hqMKyd6jrYXXwokNZKxrFDpkpBaGQMvxAADcfTlJrqEH5 YPBCTcYM8q4jbGJ6vZlqzg+IEW8sZSxkXwacT+LY4Z50KmVDdPXURQATKMHM+EEx4HUZ 2LGRC+RBS5qvsYNJgSUQ0VnWe309/Zj7ZWls6Rqg2cJbddKtCptvsixjg+BrtCENtsUd qsDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ROqLBReQE/7GkbmtaIhshZARplN5wkq7A//qiLQq9kA=; b=Q5GXzF8646GCZdx2IJh4JZZrgIXpLPyUnm2/f3i5o/ANTnTikBiyMchaKyLi/8RYI/ m9P1XJlnp8uUBhz8ZkCRY37dAX0NlunMfTWgViADkI4d9VIY3cEdH+qoyhuSV1MxGete 7oeBYelbZYj6EmtfUcuaadr1wWMO52L+YEVqr+JSMX8BPucezbfezaySnLVSc13L/zTK yEx4DZyd92xKYpPTuha3zQd62RqgR1/gKCeLZnNEwKM1LUSAmWc1LBDFhIeEEvDMtrcL mFBxxzfh1uTldMIIrMSSjyfeE81exIO2EHd0PzQatf4GRF2dIvyZj/DdS5owAi8m9bmF XFeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20210112.gappssmtp.com header.s=20210112 header.b=nxgYfvnL; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u26-20020a056a00099a00b0053e79de3fc6si27461002pfg.50.2022.09.16.00.58.09; Fri, 16 Sep 2022 00:58:25 -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=@bgdev-pl.20210112.gappssmtp.com header.s=20210112 header.b=nxgYfvnL; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229885AbiIPHXO (ORCPT + 99 others); Fri, 16 Sep 2022 03:23:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229458AbiIPHXM (ORCPT ); Fri, 16 Sep 2022 03:23:12 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50E71A50D7 for ; Fri, 16 Sep 2022 00:23:11 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id e17so30225199edc.5 for ; Fri, 16 Sep 2022 00:23:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=ROqLBReQE/7GkbmtaIhshZARplN5wkq7A//qiLQq9kA=; b=nxgYfvnLNrk+I96j5O2yz93N3SfOABT5E9o6l1hADwyr3tOCILnrCPzEDFHTnDSP3W YXTL8Ru8oR2hFRwtaKCfX3q71e6P5jfk12F4q6GgaNiOe5JHECDeqB8n35iEYxqjD2Tq gBZjbEBBszCurcyPlLpx5skqBkBxFUMXZP75U4yy+zBHxOlEKQwrdDdYbPWqXowcHCLk tyUHuUNDi4iLIGQkRfcKfVnm8oUmJZ83Eg3e8vKY7HNxhB25VFIJPr83CGLRs44c34VT +um9qJeGlhsTtoGOcaZp9X7nDi1UuC8xvZVtrWkH0W+Uz+WZQ9/xUiRla8rZN91SEEFd zjFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=ROqLBReQE/7GkbmtaIhshZARplN5wkq7A//qiLQq9kA=; b=bx+0z5SJtDTIshZxxoMwcAm2LPXgzKY0pEo/+PWuLazVD8iv5gDK/PcjSWphLCtpan ZhqyOTgGbCM4dVqxsUy0GRcxTo4Yh1iG9djQqOBmYAcfR6M+cVU+MEV3cUEFGIpTQlYS eeGBWcWShjZxtDX2SCSrfl7V1zf/enX8U4nBALKBeJSo9wpZHNEUnkzpPPRjtHgJKYoQ AKA45Ng1gPhYlU/Z74mbQ5aDGAV+L1M1M2WhNKfwO2XC/LLI7SUij8SrFqRtdTCIVIlf nWAMkHXpjqatB1uZJ4pTDO9ux+TVqDfg2vHAuYGekmZ8oteiKn4WHpkw/Tz+TrK93YVh jNVQ== X-Gm-Message-State: ACrzQf1rEJNi84lykWo9ZobSqJ7wnEO3OvjmyYQgc1Jmo9xbXK4cHhkc qXlJ6zuKFmCEJ9Yf9jZM/mj7QUgYROWn8MVCLQO/RA== X-Received: by 2002:a05:6402:5243:b0:451:6d52:5928 with SMTP id t3-20020a056402524300b004516d525928mr2846752edd.328.1663312989854; Fri, 16 Sep 2022 00:23:09 -0700 (PDT) MIME-Version: 1.0 References: <20220906211628.6u4hbpn4shjcvqel@pali> <20220906214114.vj3v32dzwxz6uqik@pali> <20220906220901.p2c44we7i4c35uvx@pali> In-Reply-To: From: Bartosz Golaszewski Date: Fri, 16 Sep 2022 09:22:59 +0200 Message-ID: Subject: Re: [PATCH 2/2] PCI: mvebu: switch to using gpiod API To: Kent Gibson Cc: Linus Walleij , Dmitry Torokhov , =?UTF-8?Q?Pali_Roh=C3=A1r?= , Shawn Guo , Lorenzo Pieralisi , Thomas Petazzoni , Bjorn Helgaas , Rob Herring , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE 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 Thu, Sep 15, 2022 at 11:30 AM Kent Gibson wrote: > > On Thu, Sep 15, 2022 at 10:51:02AM +0200, Linus Walleij wrote: > > On Thu, Sep 15, 2022 at 4:23 AM Kent Gibson wrote: > > > > > After sleeping on this, I'm even more in disagreement with renaming > > > value to state. > > > > OK let's not do that then. > > > > > OTOH, I totally agree with the addition of GPIOD_ACTIVE/INACTIVE to be > > > used for the logical cases, and even a script to apply it globally. > > > Ideally that script would change both the calls to the logical functions > > > to use ACTIVE/INACTIVE, and the physical to HIGH/LOW. > > > > OK we have consensus on this. > > > > > Introducing enums for those, and changing the function signatures to > > > use those rather than int makes sense to me too. > > > > Either they can be enum or defined to bool true/false. Not really > > sure what is best. But intuitively enum "feels better" for me. > > > > Enums work for me - especially if the goal is to differentiate > logical from physical - there should be a distinct enum for each. > We won't even have to change the function signatures if we go with enums - they already take an int and I'm in general against putting enum types into function signatures in C as they give you a false sense of a strong type. Bart > > > Though I'm not sure > > > why that has to wait until after all users are changed to the new macros. > > > Would that generate lint warnings? > > > > I rather want it all to happen at once. One preparatory commit > > adding the new types and one sed script to refactor the whole > > lot. Not gradual switchover. > > > > The reason is purely administrative: we have too many refactorings > > lagging behind, mainly the GPIO descriptors that have been > > lagging behind for what is it? 5 years? 10? GPIO irqchips also dragged > > out for way too long. We can't keep doing things gradually like > > this, it takes too much time and effort. > > > > I don't want any more "in-transition-indefinitely" stuff in the GPIO > > subsystem if I can avoid it. > > > > Therefore I would advice to switch it all over at the end of a merge > > window and be done with it. > > > > Agreed - do it all at once. My question was specific to the change of the > function signatures to using enums - what is to prevent us doing that > before running the sed script, and have the script switch usage over to > the enums? > > Cheers, > Kent.