Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp16058938rwd; Mon, 26 Jun 2023 05:20:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ewh6IDJDJ1FLZ0/Qbr80pE2D3DB2d7+y/hq7c8QyElZcoxIYxzXDy5mPbysaDFdp4lXaf X-Received: by 2002:a2e:a173:0:b0:2b4:8319:d081 with SMTP id u19-20020a2ea173000000b002b48319d081mr12962292ljl.31.1687782009736; Mon, 26 Jun 2023 05:20:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687782009; cv=none; d=google.com; s=arc-20160816; b=wDmKK4Si9UAubrRoy1vkSeUVQsqFWLbW7/yLmvGaLTmYcHmiol1STCsuN5dX6wPj6J 3TRIZYlt+XtOv4QmLAH+W42zz9yzy0YLcZ1Qcl88pGwRssWX4m2SaIuRQQyk7koBAD78 ZCJe754ElejmkbE9Do/hY+F4KLCRi6ytzPhczs+NQc1AoSSUCzzIcvXXfjtWKjhwLsVT D/6t92I2OZxUKKmLP4ZK0PRmT74mXwt2C4CiUpwgFOKin/qkJh+mq9D1Vsod2MYTFsoP Df5LYepcj2UJHSFOJQEEsDIAL6A+43Td5UPLJPQx2MvU7JpIwisasm46tVzGhzArCyUe pqtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=mgkjsepU/tTlTevS4w+BD07hBEcVZa0jwMYKEjPW8sY=; fh=FxYqtsDftbvjYJ8EGkgW5+SEfOS0o8RwUixw+2EJbug=; b=T5BC6JpwzksLf0BghBDoTb7hRn5b7wQePS7qcke/4+qk3epnAG8tG060GvAdNd9Hlc rLVqHLpyt/hXAzMh1cU00Il4P4GG62hnuaQfZo+Cu5S8hT6SVddOX521CEQRBQ/wru4O iFDqxU+keDkQ2uv7Uctc7UBxrGkuQxhs3CjyWC0qmP8xUS7GMUiAZUNFWY/+It+9nnp2 xojfkFnDBjplXKEWg1fstfDBsVr1ZHeyqFZgAh133y76YIwNNr4LLMljSNOrIq0WiZvu Nid8nFwJpmPX7G/k1DiZMsqOj9M5u1wKtGNd0tMcW/AaewlMTwfJSa8r7j+dkYvYwl2G UaNA== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h13-20020aa7c60d000000b0051da310a5f2si201465edq.544.2023.06.26.05.19.44; Mon, 26 Jun 2023 05:20: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; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229849AbjFZMLa convert rfc822-to-8bit (ORCPT + 99 others); Mon, 26 Jun 2023 08:11:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229932AbjFZML3 (ORCPT ); Mon, 26 Jun 2023 08:11:29 -0400 Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EECC1B7; Mon, 26 Jun 2023 05:11:28 -0700 (PDT) Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-98502b12fd4so77250866b.1; Mon, 26 Jun 2023 05:11:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687781486; x=1690373486; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dZhXM3abO/TWseJ+v7a10dpSoRYmrv1y4DXO0h+pT1k=; b=XCUu0fMOZMj3ruHVxzY9UIHq7zkjvv/PQhu+6XMB0zb3aE4S1YTBZh++BtTLoXDYXC ILqvEoTEzExHmq38Ovrxz0DMPAuNtmhwF3C/+pZ0A8n6DOQJ+W0wVWYKuHLipG3o1DPi oJA8XB1aExCe0+ZNlf+OE/jS8P+AJzV3HbiOGVYJwcvBEEVmLGptvYqYivgOMYSiO58r u1mMcUJg9xn+yHVYu+OZDbFFYQ0xcnq4OS7cmrI9k4dZCPm2AqE3Pg75qExslB2CDibO QboLgW8YimH3kNZmQ8bzo4fV1xgUzmxq/zLlwlG5CneR2hyUh9WH4PMSgMI+q8eykFK3 B/Xw== X-Gm-Message-State: AC+VfDypNn+vWEZV5lGuN7qgBEhg12m2CCT7hrgXP2QQHmXaERRj6GOW CEH0QedpQdHdFJDjERmwrAoVQwJ2BmHBi3xzuyklClH1 X-Received: by 2002:a17:906:100a:b0:987:81d:9d49 with SMTP id 10-20020a170906100a00b00987081d9d49mr20762464ejm.7.1687781486213; Mon, 26 Jun 2023 05:11:26 -0700 (PDT) MIME-Version: 1.0 References: <20230621151652.79579-1-andriy.shevchenko@linux.intel.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Mon, 26 Jun 2023 14:11:10 +0200 Message-ID: Subject: Re: [PATCH v2 1/2] ACPI: platform: Ignore SMB0001 only when it has resources To: Andy Shevchenko Cc: "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, acpica-devel@lists.linuxfoundation.org, Len Brown , Andi Shyti , Robert Moore , Michael Brunner Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 Mon, Jun 26, 2023 at 12:44 PM Andy Shevchenko wrote: > > On Mon, Jun 26, 2023 at 11:15:19AM +0300, Andy Shevchenko wrote: > > On Fri, Jun 23, 2023 at 04:43:55PM +0200, Rafael J. Wysocki wrote: > > > On Thu, Jun 22, 2023 at 8:19 PM Andy Shevchenko > > > wrote: > > > > On Thu, Jun 22, 2023 at 05:53:13PM +0200, Rafael J. Wysocki wrote: > > > > > On Wed, Jun 21, 2023 at 5:16 PM Andy Shevchenko > > > > > wrote: > > ... > > > > BTW, this doesn't need to increment the count even. It could just > > > terminate the walk on the first valid resource found and tell the > > > caller to return true in that case. > > > > Indeed, thank you for the hint! > > Actually it's doesn't matter if we count them or not, we still must use the > context of the call to set up a flag or whatever. No, it is sufficient to pass a pointer to a bool variable. > With the current code in mind I prefer to count resources and compare that > to be non-zero. This will help to read and understand code better. I'm not sure. The condition is "if there is at least one valid resource, skip the device". Counting them all will make casual readers wonder why IMO.