PCI: endpoint: pci-epf-ntb: Make struct pci_epf_ops const
authorLars-Peter Clausen <lars@metafoo.de>
Sat, 22 Jul 2023 23:08:46 +0000 (16:08 -0700)
committerKrzysztof Wilczyński <kwilczynski@kernel.org>
Mon, 18 Dec 2023 22:38:11 +0000 (22:38 +0000)
The pci_epf_ops struct for the PCI endpoint NTB driver is never modified.

Mark it as const so it can be placed in the read-only section.

[kwilczynski: commit log]
Link: https://lore.kernel.org/linux-pci/20230722230848.589428-3-lars@metafoo.de
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
drivers/pci/endpoint/functions/pci-epf-ntb.c

index 9aac2c6f3bb99ddd2c3515a74b59479f77f8ad4b..63018146972050512d41ed8ce1dcd7d65c909115 100644 (file)
@@ -2099,7 +2099,7 @@ static int epf_ntb_probe(struct pci_epf *epf,
        return 0;
 }
 
-static struct pci_epf_ops epf_ntb_ops = {
+static const struct pci_epf_ops epf_ntb_ops = {
        .bind   = epf_ntb_bind,
        .unbind = epf_ntb_unbind,
        .add_cfs = epf_ntb_add_cfs,