public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] PCI: rcar-gen4: make read-only const array check_addr static
@ 2024-08-22 20:59 Colin Ian King
  2024-08-23  8:00 ` Geert Uytterhoeven
  2024-09-01 17:33 ` Krzysztof Wilczyński
  0 siblings, 2 replies; 3+ messages in thread
From: Colin Ian King @ 2024-08-22 20:59 UTC (permalink / raw)
  To: Marek Vasut, Yoshihiro Shimoda, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Manivannan Sadhasivam, Rob Herring,
	Bjorn Helgaas, linux-pci, linux-renesas-soc
  Cc: kernel-janitors, linux-kernel

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 <colin.i.king@gmail.com>
---
 drivers/pci/controller/dwc/pcie-rcar-gen4.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/controller/dwc/pcie-rcar-gen4.c b/drivers/pci/controller/dwc/pcie-rcar-gen4.c
index f0f3ebd1a033..c0ea6b02f1cd 100644
--- a/drivers/pci/controller/dwc/pcie-rcar-gen4.c
+++ b/drivers/pci/controller/dwc/pcie-rcar-gen4.c
@@ -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;
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH][next] PCI: rcar-gen4: make read-only const array check_addr static
  2024-08-22 20:59 [PATCH][next] PCI: rcar-gen4: make read-only const array check_addr static Colin Ian King
@ 2024-08-23  8:00 ` Geert Uytterhoeven
  2024-09-01 17:33 ` Krzysztof Wilczyński
  1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2024-08-23  8:00 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Marek Vasut, Yoshihiro Shimoda, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Manivannan Sadhasivam, Rob Herring,
	Bjorn Helgaas, linux-pci, linux-renesas-soc, kernel-janitors,
	linux-kernel

On Thu, Aug 22, 2024 at 10:59 PM Colin Ian King <colin.i.king@gmail.com> wrote:
> 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 <colin.i.king@gmail.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][next] PCI: rcar-gen4: make read-only const array check_addr static
  2024-08-22 20:59 [PATCH][next] PCI: rcar-gen4: make read-only const array check_addr static Colin Ian King
  2024-08-23  8:00 ` Geert Uytterhoeven
@ 2024-09-01 17:33 ` Krzysztof Wilczyński
  1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Wilczyński @ 2024-09-01 17:33 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Marek Vasut, Yoshihiro Shimoda, Lorenzo Pieralisi,
	Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, linux-pci,
	linux-renesas-soc, kernel-janitors, linux-kernel

Hello,

> Don't populate the const read-only array check_addr on 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-01 17:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-22 20:59 [PATCH][next] PCI: rcar-gen4: make read-only const array check_addr static Colin Ian King
2024-08-23  8:00 ` Geert Uytterhoeven
2024-09-01 17:33 ` Krzysztof Wilczyński

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox