Skip to contentSkip to conversation

alpha: Use resource_set_range() helper

PATCH New Ilpo Järvinen 1 participant 1 message Apr 16, 2025 Alpha port

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 alpha: Use resource_set_range() helper

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

---
 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(-)
arch/alpha/kernel/core_marvel.c +6 -4
index b1bfbd11980d..c75cd4c68258 100644
@@ -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;
 
arch/alpha/kernel/core_titan.c +2 -2
index 77f5d68ed04b..c115bbee2e94 100644
@@ -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;
 
arch/alpha/kernel/core_tsunami.c +3 -2
index fc1ab73f23de..3e4d3a845e55 100644
@@ -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;
 
arch/alpha/kernel/core_wildfire.c +3 -2
index 8dd08c5e4270..00d63fc29caa 100644
@@ -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;
 
Signature · 1 line
2.39.5