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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4DFECEB64D7 for ; Mon, 26 Jun 2023 13:27:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230160AbjFZN1K (ORCPT ); Mon, 26 Jun 2023 09:27:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229621AbjFZN1J (ORCPT ); Mon, 26 Jun 2023 09:27:09 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A41E1AB; Mon, 26 Jun 2023 06:27:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687786027; x=1719322027; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=9ng5AnCmQfRGGBiaPFf18ARsNicr/v2JOScpItK0kq0=; b=dv08GUdu+H1yXapZ2AwoIyQQAKh8kap1hR07H+nnJ0qTW+mL5OGlgvb2 NwNi3F4Uqz6nRA/5OsJBwxGh2rwAacpISLKntB8Lij9V1keCpSthsbvci 74QnZbLcSM9UuJjyM1nqm76yukEakIDO8WIXMTUygMBG+C0Zo2srzRnMI rBDBO71BfFocnyfzfjLqN37EnjrAuwI0DAzdKIpS1/N/umVIaBa7G32/E EyoyGlAgs9T35rkjrHt5mUz8T/+gv9r1IZoVkYxhkqViY9vgMggan0Acb kURQCDpPnpWLy9hvoqVBYDZJaIkbJo85FG3naoCFWEPozAxiGn8GIDWg0 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10753"; a="340856231" X-IronPort-AV: E=Sophos;i="6.01,159,1684825200"; d="scan'208";a="340856231" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jun 2023 06:27:07 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10753"; a="751095173" X-IronPort-AV: E=Sophos;i="6.01,159,1684825200"; d="scan'208";a="751095173" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga001.jf.intel.com with ESMTP; 26 Jun 2023 06:27:04 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qDmFD-0002iG-0w; Mon, 26 Jun 2023 16:27:03 +0300 Date: Mon, 26 Jun 2023 16:27:03 +0300 From: Andy Shevchenko To: "Rafael J. Wysocki" Cc: 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 Subject: Re: [PATCH v2 1/2] ACPI: platform: Ignore SMB0001 only when it has resources Message-ID: References: <20230621151652.79579-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Mon, Jun 26, 2023 at 02:11:10PM +0200, Rafael J. Wysocki wrote: > 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. Okay, Can you check v3 for the rest and I can send a v4 if nothing else there? -- With Best Regards, Andy Shevchenko