summaryrefslogtreecommitdiff
path: root/drivers/peci/core.c
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 /drivers/peci/core.c
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 'drivers/peci/core.c')
-rw-r--r--drivers/peci/core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/peci/core.c b/drivers/peci/core.c
index 9c8cf07e51c7..0f83a9c6093b 100644
--- a/drivers/peci/core.c
+++ b/drivers/peci/core.c
@@ -44,7 +44,7 @@ int peci_controller_scan_devices(struct peci_controller *controller)
}
static struct peci_controller *peci_controller_alloc(struct device *dev,
- struct peci_controller_ops *ops)
+ const struct peci_controller_ops *ops)
{
struct peci_controller *controller;
int ret;
@@ -113,7 +113,7 @@ static void unregister_controller(void *_controller)
* Return: Pointer to the newly allocated controller or ERR_PTR() in case of failure.
*/
struct peci_controller *devm_peci_controller_add(struct device *dev,
- struct peci_controller_ops *ops)
+ const struct peci_controller_ops *ops)
{
struct peci_controller *controller;
int ret;