From nobody Thu Oct 2 03:34:11 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93260A95E; Wed, 24 Sep 2025 07:46:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758699979; cv=none; b=o24iPE9hBAFfFYPF+G4awDiGjtsP4eXzZys/Z1JAUeINsaZDGLoXwbAi92OT5XCLx9ci92EfGPojHaMvJPPhJ996iiOpQJE0Vm6mChvPYqMOXfLzbprwMNdPEKmMigEk0S0YGoH1VzTq+MWbSxfH0Oo3T5fMTKKJ9Je3Yu2nSlU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758699979; c=relaxed/simple; bh=JvDek3868I+EgXDu4lEVZh0rf97VIgk/Snbhy8YIQcw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mTCbjTBvsB7QIwg7uxKDGqDuDWd98l0CSt4Rt0K1iCBiG3CrPcyiwqOfIB5iYj94TMbzelbm2p7WpuHHp1bjLLNkNi2hNOR4uscmbE1HfQz7gWgP0nkBuhtSfn8B1tUNrXxOEf1ZkAweGhb0yryIBKVndSYGALFOJVdGRUcigLk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=cRGsFYix; arc=none smtp.client-ip=192.198.163.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="cRGsFYix" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758699978; x=1790235978; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JvDek3868I+EgXDu4lEVZh0rf97VIgk/Snbhy8YIQcw=; b=cRGsFYix+th60d5bT9j2W5JeUssWOP5kIP2gD5kZlqT6YYx/nF6YbIZx 62tZRhS9uQcSK5WObFq6aH5Q0vS+Tc1Dywe4OzFh+9aO+rxgBNNzGw/No gWgT5laNADXlhamO/1G3EUwXeelV97f/DSLQankUu4Nop2K7e4xhRvp+5 owf8BZjN97gDe6ROCjS7yd3UGRuUcH59HJ5iQVybhkeWkHt1n/IynV1Hb qLHwrklpq2vr9xFMwkxthAyG8QL8v5TNGQVMEbbORkpVb2wYMO7/d45H5 Muf2KNh1Sj3DmfurB0yw7Uy7WraIo/G84bOfekRCXbVPysZw0xHXyH2fh w==; X-CSE-ConnectionGUID: QkFjiIWARxe36aJDpBOpmA== X-CSE-MsgGUID: pjtkPmsURESCjazbaB+b2g== X-IronPort-AV: E=McAfee;i="6800,10657,11561"; a="72346910" X-IronPort-AV: E=Sophos;i="6.18,290,1751266800"; d="scan'208";a="72346910" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2025 00:46:14 -0700 X-CSE-ConnectionGUID: CScHHwNbR/K+jJNyCBGC2g== X-CSE-MsgGUID: O001B7FtQBqXhllo8rLSFw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,290,1751266800"; d="scan'208";a="176552705" Received: from sschumil-mobl2.ger.corp.intel.com (HELO kekkonen.fi.intel.com) ([10.245.245.128]) by orviesa009-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2025 00:46:05 -0700 Received: from punajuuri.localdomain (unknown [192.168.240.130]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 8EB9D1213E4; Wed, 24 Sep 2025 10:46:02 +0300 (EEST) Received: from sailus by punajuuri.localdomain with local (Exim 4.98.2) (envelope-from ) id 1v1KCQ-000000017Hv-2IyK; Wed, 24 Sep 2025 10:46:02 +0300 Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo From: Sakari Ailus To: linux-acpi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, linux-media@vger.kernel.org, netdev@vger.kernel.org, linux-spi@vger.kernel.org, "Rafael J. Wysocki" , Len Brown , Greg Kroah-Hartman , Danilo Krummrich , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Javier Carrasco , Dmitry Torokhov , Lee Jones , Pavel Machek , Matthias Fend , Chanwoo Choi , Krzysztof Kozlowski , Laurent Pinchart , Paul Elder , Mauro Carvalho Chehab , Horatiu Vultur , UNGLinuxDriver@microchip.com, Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Mark Brown , Thomas Gleixner , Ingo Molnar , Jonathan Cameron Subject: [PATCH v2 03/16] ACPI: property: Rework acpi_graph_get_next_endpoint() Date: Wed, 24 Sep 2025 10:45:49 +0300 Message-ID: <20250924074602.266292-4-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250924074602.266292-1-sakari.ailus@linux.intel.com> References: <20250924074602.266292-1-sakari.ailus@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Rework the code obtaining the next endpoint in acpi_graph_get_next_endpoint(). The resulting code removes unnecessary contitionals and should be easier to follow. Suggested-by: Andy Shevchenko Signed-off-by: Sakari Ailus --- drivers/acpi/property.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c index 3e85900080ac..5438592dc136 100644 --- a/drivers/acpi/property.c +++ b/drivers/acpi/property.c @@ -1399,14 +1399,15 @@ static struct fwnode_handle *acpi_graph_get_next_en= dpoint( if (!port) return NULL; =20 - endpoint =3D acpi_get_next_subnode(port, prev); - while (!endpoint) { - port =3D acpi_get_next_subnode(fwnode, port); - if (!port) + do { + endpoint =3D acpi_get_next_subnode(port, prev); + if (endpoint) break; + + port =3D acpi_get_next_subnode(fwnode, port); if (is_acpi_graph_node(port, "port")) - endpoint =3D acpi_get_next_subnode(port, NULL); - } + prev =3D NULL; + } while (port); =20 /* * The names of the endpoint nodes begin with "endpoint@" followed by --=20 2.47.3