diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2023-07-23 02:08:44 +0300 |
---|---|---|
committer | Krzysztof Wilczyński <kwilczynski@kernel.org> | 2023-12-19 01:37:54 +0300 |
commit | 86362293044b382aece355f9e4e3f7116dcd1eae (patch) | |
tree | 2fc945cdac3b03b1ceff90ee6d212abe090cda5b /include/linux/pci-epf.h | |
parent | b85ea95d086471afb4ad062012a4d73cd328fa86 (diff) | |
download | linux-86362293044b382aece355f9e4e3f7116dcd1eae.tar.xz |
PCI: endpoint: Make struct pci_epf_ops in pci_epf_driver const
The pci_epf_ops struct contains a set of callbacks that are used by the
pci_epf_driver, and is never modified by the EPF core itself.
Marking the struct pointer const allows EPF drivers to declare their
pci_epf_ops struct to be const.
This allows the struct to be placed in the read-only section. Which
for example brings some security benefits as the callbacks can not be
overwritten.
[kwilczynski: commit log]
Link: https://lore.kernel.org/linux-pci/20230722230848.589428-1-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>
Diffstat (limited to 'include/linux/pci-epf.h')
-rw-r--r-- | include/linux/pci-epf.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/pci-epf.h b/include/linux/pci-epf.h index 3f44b6aec477..764dc62b3acc 100644 --- a/include/linux/pci-epf.h +++ b/include/linux/pci-epf.h @@ -98,7 +98,7 @@ struct pci_epf_driver { void (*remove)(struct pci_epf *epf); struct device_driver driver; - struct pci_epf_ops *ops; + const struct pci_epf_ops *ops; struct module *owner; struct list_head epf_group; const struct pci_epf_device_id *id_table; |