[PATCH 2/4] PCI: of: don't zero flags in of_pci_get_addr_flags()
From: Alex Elder
Date: Fri Aug 07 2026 - 15:41:34 EST
The flags variable whose address is passed to of_pci_get_addr_flags()
is zeroed before assigning a value to it. Skip the zeroing and just
assign it instead.
Reviewed-by: Herve Codina <herve.codina@xxxxxxxxxxx>
Signed-off-by: Alex Elder <elder@xxxxxxxxxxxx>
---
drivers/pci/of_property.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/pci/of_property.c b/drivers/pci/of_property.c
index 505226b876c56..22fea1905a080 100644
--- a/drivers/pci/of_property.c
+++ b/drivers/pci/of_property.c
@@ -82,12 +82,10 @@ static int of_pci_get_addr_flags(const struct resource *res, u32 *flags)
else
return -EINVAL;
- *flags = 0;
+ *flags = FIELD_PREP(OF_PCI_ADDR_FIELD_SS, ss);
if (res->flags & IORESOURCE_PREFETCH)
*flags |= OF_PCI_ADDR_FIELD_PREFETCH;
- *flags |= FIELD_PREP(OF_PCI_ADDR_FIELD_SS, ss);
-
return 0;
}
--
2.53.0