mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Richard Henderson <richard.henderson@linaro.org>,
	Matt Turner <mattst88@gmail.com>,
	linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Subject: [PATCH 1/1] alpha: Use resource_set_range() helper
Date: Wed, 16 Apr 2025 13:22:59 +0300	[thread overview]
Message-ID: <20250416102259.7802-1-ilpo.jarvinen@linux.intel.com> (raw)

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


                 reply	other threads:[~2025-04-16 10:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250416102259.7802-1-ilpo.jarvinen@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mattst88@gmail.com \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®