lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250416102259.7802-1-ilpo.jarvinen@linux.intel.com>
Date: Wed, 16 Apr 2025 13:22:59 +0300
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: Richard Henderson <richard.henderson@...aro.org>,
	Matt Turner <mattst88@...il.com>,
	linux-alpha@...r.kernel.org,
	linux-kernel@...r.kernel.org
Cc: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Subject: [PATCH 1/1] alpha: Use resource_set_range() helper

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

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@...ux.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ