PCI: rcar-gen4: make read-only const array check_addr static
Subsystems (5)
PATCH 1/1 PCI: rcar-gen4: make read-only const array check_addr static
Don't populate the const read-only array check_addr on the stack at run time, instead make it static.
Signed-off-by Colin Ian King <[email protected]>
--- drivers/pci/controller/dwc/pcie-rcar-gen4.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/pci/controller/dwc/pcie-rcar-gen4.c +3 -1
@@ -606,7 +606,9 @@ static int rcar_gen4_pcie_reg_test_bit(struct rcar_gen4_pcie *rcar,static int rcar_gen4_pcie_download_phy_firmware (struct rcar_gen4_pcie *rcar) {/* The check_addr values are magical numbers in the datasheet */ -const u32 check_addr[] = {0x00101018 ,0x00101118 ,0x00101021 ,0x00101121 }; +static const u32 check_addr[] = { +0x00101018 ,0x00101118 ,0x00101021 ,0x00101121 + };struct dw_pcie *dw = &rcar->dw;const struct firmware *fw;unsigned int i, timeout;
Signature · 1 line
2.39.2
Quoted 4 lines · Colin Ian King
Don't populate the const read-only array
check_addron the stack at run time, instead make it static.Signed-off-by Colin Ian King <[email protected]>
Reviewed-by Geert Uytterhoeven <[email protected]>
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Krzysztof Wilczyński
AppliedHello,
Quoted 2 lines
Don't populate the const read-only array
check_addron the stack at run time, instead make it static.
Applied to controller/rcar-gen4, thank you!
[1/1] PCI: rcar-gen4: Make read-only const array check_addr static
https://git.kernel.org/pci/pci/c/5603a3491b36 Krzysztof