From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.13 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796140877; b=m0U3XmDjLMDj7bDWp7gl8bywsCRB8T8GmFWaGvTNU21EWeMVumozymvTpwNuRCqONlWQ zKsUn+XfUOov196CwjK0ZfWzELwAX0RyvpsiH3YfEhqsg7nI/vxSo9r4y/xCQx/JqX1QL VMZM5e5z0Wy+5/bvvdXXvpMuRgVlibtQUzeV/6dn3N4FOnEp5ntnhVRVQRrkq91rIem6W HueNSEZJSh0SOa55wd3yy6oIhodbVuyPCuDEvr1DPmmMgKJb8eOqzmMrQQiJyCPv8TRc/ 3Qs+R59a/2grw644/MFF90J9VI01KdHXxmThf1OehyRBPE4f/K+WSBffcqzcwUA2P9A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796140877; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Type:Content-Transfer-Encoding; bh=aBOU4oskqe2gNPSXpRsa90L2tfLcMpZJ7xpzNcOV/x4=; b=jZY9F3V+lbg1Ky6mWSMRijWejulpWA0aMH7h/SGRiQXvEuZ5VKI8d6uyyzlSE3OfLfyk 56eDisErCiLQeEHnF89iBPVdLRjUK/DcFPmP5gIiyTx6W32q1RGsZU/H9GqlEHIBlGpCB BFHYH60gQbHmUlCDH6HsISYkxQNsJgiqaxdndmWo+LPHFHR4f230qoK8KogJ6RoUdD2AV f0CMpQ/it+RSoncK6dcIxg0LnGHZGBS2FPX29JIqS7OEzTkBb4p9GuFIwn1rZqt7z/f7R xd6tZKyiYpHkP5CeJSKobcbyzt9pZhGOZxEKCkndDHUxbaCD9kqGhizvA9t27uxakJQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=i8EO0kIX; arc=none smtp.remote-ip=192.198.163.13 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66042606A31A for ; Tue, 1 Dec 2026 16:01:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 66042606A31A 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.a=rsa-sha256 header.s=Intel header.b=i8EO0kIX DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796140878; x=1827676878; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aBOU4oskqe2gNPSXpRsa90L2tfLcMpZJ7xpzNcOV/x4=; b=i8EO0kIXUpTLAYyGoP3aLJae5nV1ooCdzk0ZfEBZdwjUiFPm4BsSs5wU xpsj0raM/6O4xCkst8gx5GYTPHOeIOGvd0PW3PbJU61SSurOUQhC/cGJq xezFU7iKv5Sqa2wyHfB9XZGctx6Sv2Eh9CtdpCfQprJi8WMiCOGE+s4TI L32CegwVf3uy/8Fj1kt6zo52FJDQJRDP+ATj3kB9JeZmLjtCZPius4giB rJpCmACS5mlMYd2GHxhDmgFYk+49HLFVQgB4GUgPsRZmCwcd+AQ0dLjja +J95obY8RbMooKavvSpvL/4QE0rU+wx0MMpRNdQLWSWqWOxjr83dCIqJA Q==; X-CSE-ConnectionGUID: 5bPpdAeeSJGbiR5bDFYfxA== X-CSE-MsgGUID: h7VbCheNQi2GYKYx7qsRmw== X-IronPort-AV: E=McAfee;i="6800,10657,11983"; a="4991310" X-IronPort-AV: E=Sophos;i="6.27,245,1787036400"; d="scan'208";a="4991310" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2026 08:01:12 -0800 X-CSE-ConnectionGUID: rIrvNoadTB2DCj96E9jtmQ== X-CSE-MsgGUID: IXE7xWueRNWm8gh4nMkt+Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,245,1787036400"; d="scan'208";a="4730707" Received: from pgcooper-mobl3.ger.corp.intel.com (HELO localhost) ([10.245.245.21]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2026 08:01:03 -0800 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= To: Bjorn Helgaas , Lorenzo Pieralisi , Rob Herring , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Matthew Brost , =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , =?UTF-8?q?Micha=C5=82=20Winiarski?= , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , David Airlie , Simona Vetter , dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Subject: [PATCH 10/15] resource: Rename next_resource() and for_each_resource() Date: Tue, 1 Dec 2026 17:58:34 +0200 Message-ID: <20261201155844.2278-11-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261201155844.2278-1-ilpo.jarvinen@linux.intel.com> References: <20261201155844.2278-1-ilpo.jarvinen@linux.intel.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The names of next_resource() and for_each_resource() do not tell that they traverse the resource tree. for_each_resource() is also already used by drbd for its own resources, which prevents making the macro available outside of resource.c under that name. Rename next_resource() to resource_tree_next() and for_each_resource() to resource_tree_for_each(). No functional changes. Signed-off-by: Ilpo Järvinen --- kernel/resource.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/kernel/resource.c b/kernel/resource.c index 1b64a65fc591..8d6928c638ff 100644 --- a/kernel/resource.c +++ b/kernel/resource.c @@ -66,8 +66,8 @@ static DEFINE_RWLOCK(resource_lock); * traversal. If @p is a descendant of @subtree_root, only traverse * the subtree under @subtree_root. */ -static struct resource *next_resource(struct resource *p, bool skip_children, - struct resource *subtree_root) +static struct resource *resource_tree_next(struct resource *p, bool skip_children, + struct resource *subtree_root) { if (!skip_children && p->child) return p->child; @@ -86,9 +86,9 @@ static struct resource *next_resource(struct resource *p, bool skip_children, * NOTE: '__p' is introduced to avoid shadowing '_p' outside of loop. * And it is referenced to avoid unused variable warning. */ -#define for_each_resource(_root, _p, _skip_children) \ +#define resource_tree_for_each(_root, _p, _skip_children) \ for (typeof(_root) __root = (_root), __p = _p = __root->child; \ - __p && _p; _p = next_resource(_p, _skip_children, __root)) + __p && _p; _p = resource_tree_next(_p, _skip_children, __root)) #ifdef CONFIG_PROC_FS @@ -102,7 +102,7 @@ static void *r_start(struct seq_file *m, loff_t *pos) loff_t l = *pos; read_lock(&resource_lock); - for_each_resource(root, p, false) { + resource_tree_for_each(root, p, false) { if (l-- == 0) break; } @@ -116,7 +116,7 @@ static void *r_next(struct seq_file *m, void *v, loff_t *pos) (*pos)++; - return (void *)next_resource(p, false, NULL); + return (void *)resource_tree_next(p, false, NULL); } static void r_stop(struct seq_file *m, void *v) @@ -388,7 +388,7 @@ static int find_next_res(struct resource *parent, resource_size_t start, read_lock(&resource_lock); - for_each_resource(parent, p, skip_children) { + resource_tree_for_each(parent, p, skip_children) { /* If we passed the resource we are looking for, stop */ if (p->start > end) { p = NULL; @@ -654,7 +654,7 @@ static int __region_intersects(struct resource *parent, resource_size_t start, * |-- "System RAM" --||-- "CXL Window 0a" --| */ covered = false; - for_each_resource(p, dp, false) { + resource_tree_for_each(p, dp, false) { if (!resource_overlaps(dp, &res)) continue; if (is_type_match(dp, flags, desc)) { @@ -1869,7 +1869,7 @@ int iomem_map_sanity_check(resource_size_t addr, unsigned long size) int err = 0; read_lock(&resource_lock); - for_each_resource(&iomem_resource, p, false) { + resource_tree_for_each(&iomem_resource, p, false) { /* * We can probably skip the resources without * IORESOURCE_IO attribute? @@ -1918,7 +1918,7 @@ bool resource_is_exclusive(struct resource *root, u64 addr, resource_size_t size struct resource *p; read_lock(&resource_lock); - for_each_resource(root, p, skip_children) { + resource_tree_for_each(root, p, skip_children) { if (p->start >= addr + size) break; if (p->end < addr) { -- 2.47.3