PCI: endpoint: pci-epf-test: Make struct pci_epf_ops const
authorLars-Peter Clausen <lars@metafoo.de>
Sat, 22 Jul 2023 23:08:48 +0000 (16:08 -0700)
committerKrzysztof Wilczyński <kwilczynski@kernel.org>
Mon, 18 Dec 2023 22:38:19 +0000 (22:38 +0000)
The pci_epf_ops struct for the PCI endpoint test 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-5-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-test.c

index 1f0d2b84296a34f081648dcc783cdb96fe8accb7..7cc1c5c70afc0545aa00baf1702bd03f331f4756 100644 (file)
@@ -973,7 +973,7 @@ static int pci_epf_test_probe(struct pci_epf *epf,
        return 0;
 }
 
-static struct pci_epf_ops ops = {
+static const struct pci_epf_ops ops = {
        .unbind = pci_epf_test_unbind,
        .bind   = pci_epf_test_bind,
 };