PCI: histb: constify dw_pcie_host_ops structure

Message ID 1540665079-27788-1-git-send-email-Julia.Lawall@lip6.fr
State New
Delegated to: Lorenzo Pieralisi
Headers show
Series
  • PCI: histb: constify dw_pcie_host_ops structure
Related show

Commit Message

Julia Lawall Oct. 27, 2018, 6:31 p.m.
The dw_pcie_host_ops structure is only stored in the ops field
of a pcie_port structure, and this field is const, so make the
dw_pcie_host_ops structure const as well.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/pci/controller/dwc/pcie-histb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Shawn Guo Oct. 29, 2018, 2 a.m. | #1
On Sun, Oct 28, 2018 at 3:06 AM Julia Lawall <Julia.Lawall@lip6.fr> wrote:
>
> The dw_pcie_host_ops structure is only stored in the ops field
> of a pcie_port structure, and this field is const, so make the
> dw_pcie_host_ops structure const as well.
>
> Done with the help of Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Acked-by: Shawn Guo <shawn.guo@linaro.org>

Patch

diff -u -p a/drivers/pci/controller/dwc/pcie-histb.c b/drivers/pci/controller/dwc/pcie-histb.c
--- a/drivers/pci/controller/dwc/pcie-histb.c
+++ b/drivers/pci/controller/dwc/pcie-histb.c
@@ -202,7 +202,7 @@  static int histb_pcie_host_init(struct p
 	return 0;
 }
 
-static struct dw_pcie_host_ops histb_pcie_host_ops = {
+static const struct dw_pcie_host_ops histb_pcie_host_ops = {
 	.rd_own_conf = histb_pcie_rd_own_conf,
 	.wr_own_conf = histb_pcie_wr_own_conf,
 	.host_init = histb_pcie_host_init,