From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.8 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796431343; b=dadX9WV647LJCj6JWg1kOrki9T/fQoYrxihuIB1Omr5ArYVsVekjWymJyYMc0h1kUr6E TLnnIbTkwER23me5KlBFmAPvRypDVVAIT6zuIAtzX6wbTtWrg+CoZiFyuUCGUJS4Zec4/ YqqCruPHJS12LP8kvj8yLyFpVdvw7EgGqad+z32DB8m8Qd82yjnLtXrFfJ1M2ao+yW2oR oKqUEnna60Ij1R1lHC59PU7eNMYIC5Ya+5pFRak6JHwTZ5wn0mcA+vxeomCoRrDOh/FzD 4SxNFkOImZ4C7FweQ3VVcjEX6EcZpZdzkLcg+2eKMDAycayv4YbRZfUlef/qCC2PPyw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796431343; 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=eO7XcBVhP8DLIzBhluRk458M8GlOOGTrXET0cA4+hGU=; b=XvMwIK7YtyCKpgA/Q3txEGdtxpd4EEiXq05e88YaEKuIAm7M//c3Hz4OrX2+8gavi5C9 v035nvB3Rwe1aPNSP1WA77mseDM+yd03fB7V6+PR9FaXmkbfjAOVOfUt598LWlMTDgEep Xz2/FHV4Y2HpnfxFhTskiQJlBknZ1KCtl8pQDXx0sFGHp50u3+TWxP/SK3495wRqA0odu B98n3HnpuSB4TCJ3z6ExABq/kvGNd0QQd+yncfVqiGM58q1LXFoVoi6yO6rWv3ZyNcOf5 pOhRzxk7sXgAiuzTsmvXl2y6PYEBiG+ifOV3ayF0074qRFP0e0WRdPSbZK9jghzOpJQ== 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=SRkIK0fq; arc=none smtp.remote-ip=192.198.163.8 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 E1050606A322 for ; Sat, 5 Dec 2026 00:42:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E1050606A322 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=SRkIK0fq DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796431343; x=1827967343; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eO7XcBVhP8DLIzBhluRk458M8GlOOGTrXET0cA4+hGU=; b=SRkIK0fq+SHV1UnkFXI/Ss5j5cBF24PWxJQ87+OrFQGlqQ2LNemEkFMW HWnX9gY9afLOSq8VQ841YVW789RTEMqvcSSlRRrXImQhl+F0bT/AVOXEN 5NpAWN5q+sS2yMgSYj7LjHAUD7MuTyT5duWpXydrJ1/HtPZ2EczIkn+78 ffcs4c/hJzVU4IUmzvf1q7Hwwah+PwEWZ9fbi+vO7D4NZ347a76ZwyBj/ Ly7tSxYWZ8Tmz2cuV0EtYE0W7vyKXBY5+MXKXkb30yL9YWrgnI4MYxXo8 H+1jl6MNmYlviiUFQ/PyKZXrsN3l9uEfNsYP8k/I9kbVKDtUx82LVv2Uj Q==; X-CSE-ConnectionGUID: iXvuGufmRg+TwXIY/4nagA== X-CSE-MsgGUID: FxgE6QPdQjWMkjqe0KbGDw== X-IronPort-AV: E=McAfee;i="6800,10657,11986"; a="5308056" X-IronPort-AV: E=Sophos;i="6.29,79,1794902400"; d="scan'208";a="5308056" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 16:42:22 -0800 X-CSE-ConnectionGUID: PrguTQJNT2S26aY6CCSYaA== X-CSE-MsgGUID: PlS+z9zaQtaGX2YghHJbNg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,79,1794902400"; d="scan'208";a="14412212" Received: from ijarvine-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.245.47]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 16:42:15 -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, Anthony Pighin , linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Subject: [PATCH v2 10/16] resource: Rename next_resource() and for_each_resource() Date: Sat, 5 Dec 2026 02:39:45 +0200 Message-ID: <20261205003957.3304-11-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261205003957.3304-1-ilpo.jarvinen@linux.intel.com> References: <20261205003957.3304-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 9761aae4f4f8..fff69b044a6d 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