Skip to content

Commit d895ce7

Browse files
rikardfalkebornLorenzo Pieralisi
authored andcommitted
PCI: tegra: Constify static structs
The only usage of them is to assign their address to the 'ops' field in the pcie_port and the dw_pcie_ep structs, both which are pointers to const. Make them const to allow the compiler to put them in read-only memory. Link: https://lore.kernel.org/r/20210207221604.48910-1-rikard.falkeborn@gmail.com Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Reviewed-by: Krzysztof Wilczyński <kw@linux.com>
1 parent a38fd87 commit d895ce7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/pci/controller/dwc/pcie-tegra194.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ static const struct dw_pcie_ops tegra_dw_pcie_ops = {
10191019
.stop_link = tegra_pcie_dw_stop_link,
10201020
};
10211021

1022-
static struct dw_pcie_host_ops tegra_pcie_dw_host_ops = {
1022+
static const struct dw_pcie_host_ops tegra_pcie_dw_host_ops = {
10231023
.host_init = tegra_pcie_dw_host_init,
10241024
};
10251025

@@ -1881,7 +1881,7 @@ tegra_pcie_ep_get_features(struct dw_pcie_ep *ep)
18811881
return &tegra_pcie_epc_features;
18821882
}
18831883

1884-
static struct dw_pcie_ep_ops pcie_ep_ops = {
1884+
static const struct dw_pcie_ep_ops pcie_ep_ops = {
18851885
.raise_irq = tegra_pcie_ep_raise_irq,
18861886
.get_features = tegra_pcie_ep_get_features,
18871887
};

0 commit comments

Comments
 (0)