linux-alpha.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] alpha: Use resource_set_range() helper
@ 2025-04-16 10:22 Ilpo Järvinen
  0 siblings, 0 replies; only message in thread
From: Ilpo Järvinen @ 2025-04-16 10:22 UTC (permalink / raw)
  To: Richard Henderson, Matt Turner, linux-alpha, linux-kernel
  Cc: Ilpo Järvinen

Convert open coded resource size calculations to use
resource_set_range() helper.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 arch/alpha/kernel/core_marvel.c   | 10 ++++++----
 arch/alpha/kernel/core_titan.c    |  4 ++--
 arch/alpha/kernel/core_tsunami.c  |  5 +++--
 arch/alpha/kernel/core_wildfire.c |  5 +++--
 4 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/arch/alpha/kernel/core_marvel.c b/arch/alpha/kernel/core_marvel.c
index b1bfbd11980d..c75cd4c68258 100644
--- a/arch/alpha/kernel/core_marvel.c
+++ b/arch/alpha/kernel/core_marvel.c
@@ -238,13 +238,15 @@ io7_init_hose(struct io7 *io7, int port)
 	 */
 	hose->config_space_base = (unsigned long)IO7_CONF_KERN(io7->pe, port);
 
-	hose->io_space->start = (unsigned long)IO7_IO_KERN(io7->pe, port);
-	hose->io_space->end = hose->io_space->start + IO7_IO_SPACE - 1;
+	resource_set_range(hose->io_space,
+			   (unsigned long)IO7_IO_KERN(io7->pe, port),
+			   IO7_IO_SPACE);
 	hose->io_space->name = mk_resource_name(io7->pe, port, "IO");
 	hose->io_space->flags = IORESOURCE_IO;
 
-	hose->mem_space->start = (unsigned long)IO7_MEM_KERN(io7->pe, port);
-	hose->mem_space->end = hose->mem_space->start + IO7_MEM_SPACE - 1;
+	resource_set_range(hose->mem_space,
+			   (unsigned long)IO7_MEM_KERN(io7->pe, port),
+			   IO7_MEM_SPACE);
 	hose->mem_space->name = mk_resource_name(io7->pe, port, "MEM");
 	hose->mem_space->flags = IORESOURCE_MEM;
 
diff --git a/arch/alpha/kernel/core_titan.c b/arch/alpha/kernel/core_titan.c
index 77f5d68ed04b..c115bbee2e94 100644
--- a/arch/alpha/kernel/core_titan.c
+++ b/arch/alpha/kernel/core_titan.c
@@ -271,8 +271,8 @@ titan_init_one_pachip_port(titan_pachip_port *port, int index)
 	hose->config_space_base = TITAN_CONF(index);
 	hose->index = index;
 
-	hose->io_space->start = TITAN_IO(index) - TITAN_IO_BIAS;
-	hose->io_space->end = hose->io_space->start + TITAN_IO_SPACE - 1;
+	resource_set_range(hose->io_space, TITAN_IO(index) - TITAN_IO_BIAS,
+			   TITAN_IO_SPACE);
 	hose->io_space->name = pci_io_names[index];
 	hose->io_space->flags = IORESOURCE_IO;
 
diff --git a/arch/alpha/kernel/core_tsunami.c b/arch/alpha/kernel/core_tsunami.c
index fc1ab73f23de..3e4d3a845e55 100644
--- a/arch/alpha/kernel/core_tsunami.c
+++ b/arch/alpha/kernel/core_tsunami.c
@@ -271,8 +271,9 @@ tsunami_init_one_pchip(tsunami_pchip *pchip, int index)
 	hose->config_space_base = TSUNAMI_CONF(index);
 	hose->index = index;
 
-	hose->io_space->start = TSUNAMI_IO(index) - TSUNAMI_IO_BIAS;
-	hose->io_space->end = hose->io_space->start + TSUNAMI_IO_SPACE - 1;
+	resource_set_range(hose->io_space,
+			   TSUNAMI_IO(index) - TSUNAMI_IO_BIAS,
+			   TSUNAMI_IO_SPACE);
 	hose->io_space->name = pci_io_names[index];
 	hose->io_space->flags = IORESOURCE_IO;
 
diff --git a/arch/alpha/kernel/core_wildfire.c b/arch/alpha/kernel/core_wildfire.c
index 8dd08c5e4270..00d63fc29caa 100644
--- a/arch/alpha/kernel/core_wildfire.c
+++ b/arch/alpha/kernel/core_wildfire.c
@@ -78,8 +78,9 @@ wildfire_init_hose(int qbbno, int hoseno)
 	hose->config_space_base = WILDFIRE_CONF(qbbno, hoseno);
 	hose->index = (qbbno << 3) + hoseno;
 
-	hose->io_space->start = WILDFIRE_IO(qbbno, hoseno) - WILDFIRE_IO_BIAS;
-	hose->io_space->end = hose->io_space->start + WILDFIRE_IO_SPACE - 1;
+	resource_set_range(hose->io_space,
+			   WILDFIRE_IO(qbbno, hoseno) - WILDFIRE_IO_BIAS,
+			   WILDFIRE_IO_SPACE);
 	hose->io_space->name = pci_io_names[hoseno];
 	hose->io_space->flags = IORESOURCE_IO;
 
-- 
2.39.5


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-04-16 10:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-16 10:22 [PATCH 1/1] alpha: Use resource_set_range() helper Ilpo Järvinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).