Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1241232rwd; Sun, 14 May 2023 15:50:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5TEaXlWvJNYpdQVfpEmTAEo40X1SHPyesWE+0Q5csQtyJOwxOrYCsxB1WCSltS/86EBv1V X-Received: by 2002:a17:90b:4d89:b0:24d:ef23:fe28 with SMTP id oj9-20020a17090b4d8900b0024def23fe28mr29523815pjb.49.1684104609208; Sun, 14 May 2023 15:50:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684104609; cv=none; d=google.com; s=arc-20160816; b=yPaeOVaDCQRZsVGdIJ5jV1BOIOcr1r394kkwFl/X6Egr4fs6rZKXuBagddmOIxpg/x FgaJxxkqxeJYI8zIQzNl/XiVEkwnmJAxLaiNyAyZipWinVbx63g1+MMuqVKiQRzbJ1Ma 9QrWHCQ5o/K2Br+IIE+wmDW8ZW6rg4ONuSEvFckEmSt8RtQs5VP16vzwy237TrQjktp3 U5rYQ0M8pCd+1fe+tXEUhMI68d76Bj6gyKbHzBtSKJSlZaTArex1lcHPCnpYV7a1K8Xw I5knBliTgYa4pJo55UhKBRg6trj1gX8lM7WHA8hrbRydV++rNbzRSfMXtZliTwBiYZ6y qRsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=+AvGVwzEf60CveOQLLysrbI7WP5AXv+puofwPzspQHs=; b=Bup38nbvxO0lMZAeCxYICSoSNoydM0IeeVCzf5f3BKjgDV14nElpn/e3C0NzPS3gSi Q4Cnyegg21llvuVYCgRpqMoEFzDlzKzzCy2eGIRqctMGOdBoQXugdS0tiURyY2MThTvr c4vy88icoKoQpBaSvmkVgipEhWMnchO44rJHJVMIKy2wmsYojFxONCbgglfzqKpdKW7J OwbcxROu8uRRZ2XfMx29koYjJ8gVcTCsD5WnNjaJ+/9L6DEtvSvmJN6FMNoDx4+zZJ3Q ZoPb5JbicA6YxvNrCh1SEAgs2oicvL17DoxGZeBY3nRSIC625aYj10Zy7/8/eC1VyDfd +B6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alliedtelesis.co.nz header.s=mail181024 header.b=K4DiqR3p; 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=QUARANTINE sp=REJECT dis=NONE) header.from=alliedtelesis.co.nz Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t5-20020a17090abc4500b00247ad11b6d3si5976951pjv.88.2023.05.14.15.49.55; Sun, 14 May 2023 15:50:09 -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=@alliedtelesis.co.nz header.s=mail181024 header.b=K4DiqR3p; 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=QUARANTINE sp=REJECT dis=NONE) header.from=alliedtelesis.co.nz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232244AbjENW1p (ORCPT + 99 others); Sun, 14 May 2023 18:27:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbjENW1o (ORCPT ); Sun, 14 May 2023 18:27:44 -0400 Received: from gate2.alliedtelesis.co.nz (gate2.alliedtelesis.co.nz [202.36.163.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEB7110F0 for ; Sun, 14 May 2023 15:27:41 -0700 (PDT) Received: from svr-chch-seg1.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id BC2272C0616; Mon, 15 May 2023 10:27:39 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1684103259; bh=+AvGVwzEf60CveOQLLysrbI7WP5AXv+puofwPzspQHs=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=K4DiqR3puC7ofTBnyUtnjQNYssQsW/7nCjYroRY+TX/OeqlZ37l9SjhRNu0ggWtsG AqrHdhF4DFDbXjMd4rVuqDVYRAq7LqhvkLZc8+4/2qHZr2ImiJOO2BPqtd8oMgEDOD MUkJxB1CwFZn0UtOO8/2RaBN2VaLjiV1uyIXdXpbvQlVyl6DJSKsWXaki6DbMOrTO0 Xu1Q0lZtzEYZsJTZY3lAGm/u/XALkjink+cp2QgEafTdoKwOFgAiqmVQ22ZggtGZaz Mcs9gJLiP9BNFFCXWVG+0PMsE/OwdsgWEM/yvHMCC2XXw/XoUjKv6R3eJK7+L+UgTs JZdqkHtZUQnsA== Received: from svr-chch-ex2.atlnz.lc (Not Verified[2001:df5:b000:bc8::76]) by svr-chch-seg1.atlnz.lc with Trustwave SEG (v8,2,6,11305) id ; Mon, 15 May 2023 10:27:39 +1200 Received: from svr-chch-ex1.atlnz.lc (2001:df5:b000:bc8::77) by svr-chch-ex2.atlnz.lc (2001:df5:b000:bc8:f753:6de:11c0:a008) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.1118.26; Mon, 15 May 2023 10:27:39 +1200 Received: from svr-chch-ex2.atlnz.lc (2001:df5:b000:bc8::76) by svr-chch-ex1.atlnz.lc (2001:df5:b000:bc8::77) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Mon, 15 May 2023 10:27:39 +1200 Received: from svr-chch-ex2.atlnz.lc ([fe80::a9eb:c9b7:8b52:9567]) by svr-chch-ex2.atlnz.lc ([fe80::a9eb:c9b7:8b52:9567%15]) with mapi id 15.02.1118.026; Mon, 15 May 2023 10:27:39 +1200 From: Chris Packham To: Linus Walleij CC: "brgl@bgdev.pl" , "johan@kernel.org" , "andy.shevchenko@gmail.com" , "maz@kernel.org" , Ben Brown , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] gpiolib: Avoid side effects in gpio_is_visible() Thread-Topic: [PATCH] gpiolib: Avoid side effects in gpio_is_visible() Thread-Index: AQHZhIoofApft8Zm8kuYZtpxH+f53K9VfDeAgAQYHQA= Date: Sun, 14 May 2023 22:27:39 +0000 Message-ID: References: <20230512042806.3438373-1-chris.packham@alliedtelesis.co.nz> In-Reply-To: Accept-Language: en-NZ, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.33.22.30] Content-Type: text/plain; charset="utf-8" Content-ID: Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-SEG-SpamProfiler-Analysis: v=2.3 cv=cLieTWWN c=1 sm=1 tr=0 a=Xf/6aR1Nyvzi7BryhOrcLQ==:117 a=xqWC_Br6kY4A:10 a=75chYTbOgJ0A:10 a=IkcTkHD0fZMA:10 a=P0xRbXHiH_UA:10 a=wZaDqkZhScmTiNAJxg4A:9 a=QEXdDO2ut3YA:10 X-SEG-SpamProfiler-Score: 0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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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