From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: linux-pci@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>,
Shawn Jin <shawn.jin@asteralabs.com>,
linuxppc-dev@lists.ozlabs.org,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
linux-kernel@vger.kernel.org
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Subject: [PATCH 05/11] resource: Make resource_alignment() input const resource
Date: Wed, 29 Apr 2026 15:26:11 +0300 [thread overview]
Message-ID: <20260429122617.7324-6-ilpo.jarvinen@linux.intel.com> (raw)
In-Reply-To: <20260429122617.7324-1-ilpo.jarvinen@linux.intel.com>
resource_alignment() does not need to change resource so it can be
made const.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
include/linux/ioport.h | 2 +-
kernel/resource.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 3c73c9c0d4f7..f7930b3dfd0a 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -261,7 +261,7 @@ extern int allocate_resource(struct resource *root, struct resource *new,
struct resource *lookup_resource(struct resource *root, resource_size_t start);
int adjust_resource(struct resource *res, resource_size_t start,
resource_size_t size);
-resource_size_t resource_alignment(struct resource *res);
+resource_size_t resource_alignment(const struct resource *res);
/**
* resource_set_size - Calculate resource end address from size and start
diff --git a/kernel/resource.c b/kernel/resource.c
index d02a53fb95d8..3d17e3196a3e 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -1238,7 +1238,7 @@ reserve_region_with_split(struct resource *root, resource_size_t start,
*
* Returns alignment on success, 0 (invalid alignment) on failure.
*/
-resource_size_t resource_alignment(struct resource *res)
+resource_size_t resource_alignment(const struct resource *res)
{
switch (res->flags & (IORESOURCE_SIZEALIGN | IORESOURCE_STARTALIGN)) {
case IORESOURCE_SIZEALIGN:
--
2.39.5
next prev parent reply other threads:[~2026-04-29 12:27 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-29 12:26 [PATCH 00/11] PCI: pci_resource_alignment() improvement + cleanups Ilpo Järvinen
2026-04-29 12:26 ` [PATCH 01/11] PCI: Log all resource claims Ilpo Järvinen
2026-04-29 12:26 ` [PATCH 02/11] PCI: Rename added to add_list Ilpo Järvinen
2026-04-29 12:26 ` [PATCH 03/11] PCI: Consolidate add_list (aka realloc_head) empty sanity checks Ilpo Järvinen
2026-04-29 12:26 ` [PATCH 04/11] PCI: Remove const removal cast Ilpo Järvinen
2026-04-29 12:26 ` Ilpo Järvinen [this message]
2026-04-29 12:26 ` [PATCH 06/11] powerpc/pseries: Make pseries_get_iov_fw_value() & pnv_iov_get() pci_dev const Ilpo Järvinen
2026-04-29 12:26 ` [PATCH 07/11] PCI: Make pci_sriov_resource_alignment() " Ilpo Järvinen
2026-04-29 12:26 ` [PATCH 08/11] PCI: Convert pci_resource_alignment() input parameters to const Ilpo Järvinen
2026-04-29 12:26 ` [PATCH 09/11] PCI: Move pci_resource_alignment() to setup-res.c file Ilpo Järvinen
2026-04-29 12:26 ` [PATCH 10/11] PCI: Lower bound bridge window alignment Ilpo Järvinen
2026-04-29 12:26 ` [PATCH 11/11] PCI: Return valid alignment for assigned resources Ilpo Järvinen
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=20260429122617.7324-6-ilpo.jarvinen@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=shawn.jin@asteralabs.com \
/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