summaryrefslogtreecommitdiffstats
path: root/drivers/w1
diff options
context:
space:
mode:
authorRikard Falkeborn <rikard.falkeborn@gmail.com>2020-10-04 21:32:00 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-05 13:21:49 +0200
commit07f8569fbe44f35e53c7a5946fbb348432c68377 (patch)
tree6239f10de4b1c17da5a29be57388d17f3bbf5946 /drivers/w1
parentintel_th: pci: Add Alder Lake CPU support (diff)
downloadlinux-07f8569fbe44f35e53c7a5946fbb348432c68377.tar.xz
linux-07f8569fbe44f35e53c7a5946fbb348432c68377.zip
w1: Constify struct w1_family_ops
The fops field in the w1_family struct is never modified. Make it const to indicate that. Constifying the pointer makes it possible for drivers to declare static w1_family_ops structs const, which in turn will allow the compiler to put it in read-only memory. Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Link: https://lore.kernel.org/r/20201004193202.4044-2-rikard.falkeborn@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/w1')
-rw-r--r--drivers/w1/w1.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index e58c7592008d..6bd64bcb6316 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -613,7 +613,7 @@ end:
static int w1_family_notify(unsigned long action, struct w1_slave *sl)
{
- struct w1_family_ops *fops;
+ const struct w1_family_ops *fops;
int err;
fops = sl->family->fops;