summaryrefslogtreecommitdiff
path: root/include/linux/peci.h
diff options
context:
space:
mode:
authorZev Weiss <zev@bewilderbeest.net>2023-06-23 16:28:05 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-08-04 16:21:30 +0200
commit8306d6f35dbde19fe2d56964159fa2b4c6343bc1 (patch)
treea0e07d33e61b94cce42356cc0d6f7887dce2d72d /include/linux/peci.h
parenta436194d0ee94ec67522647ace5a36a2126b6a0e (diff)
peci: Constify struct peci_controller_ops
As with most ops structs, we never modify it at runtime, and keeping function pointers in read-only memory is generally a good thing security-wise. Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Link: https://lore.kernel.org/r/20230327224315.11135-1-zev@bewilderbeest.net Reviewed-by: Iwona Winiarska <iwona.winiarska@intel.com> Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com> Link: https://lore.kernel.org/r/20230623142805.577612-1-iwona.winiarska@intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/peci.h')
-rw-r--r--include/linux/peci.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/peci.h b/include/linux/peci.h
index 06e6ef935297..9b3d36aff431 100644
--- a/include/linux/peci.h
+++ b/include/linux/peci.h
@@ -42,13 +42,13 @@ struct peci_controller_ops {
*/
struct peci_controller {
struct device dev;
- struct peci_controller_ops *ops;
+ const struct peci_controller_ops *ops;
struct mutex bus_lock; /* held for the duration of xfer */
u8 id;
};
struct peci_controller *devm_peci_controller_add(struct device *parent,
- struct peci_controller_ops *ops);
+ const struct peci_controller_ops *ops);
static inline struct peci_controller *to_peci_controller(void *d)
{