]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
PCI: of_property: Constify parameter in of_pci_get_addr_flags()
authorHerve Codina <herve.codina@bootlin.com>
Mon, 24 Feb 2025 14:13:54 +0000 (15:13 +0100)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 28 Feb 2025 21:13:07 +0000 (15:13 -0600)
The res parameter has no reason to be a pointer to an un-const struct
resource. Indeed, struct resource is not supposed to be modified by the
function.

Constify the res parameter.

Link: https://lore.kernel.org/r/20250224141356.36325-5-herve.codina@bootlin.com
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
drivers/pci/of_property.c

index a6acd64ff8695819ed3bdc00d32b72b42a27465a..afc229843d0783b777ea3978db14c6ddf8137c3f 100644 (file)
@@ -69,7 +69,7 @@ static void of_pci_set_address(struct pci_dev *pdev, u32 *prop, u64 addr,
        }
 }
 
-static int of_pci_get_addr_flags(struct resource *res, u32 *flags)
+static int of_pci_get_addr_flags(const struct resource *res, u32 *flags)
 {
        u32 ss;