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>
This commit is contained in:
parent
9f126c56b9
commit
07f8569fbe
|
@ -613,7 +613,7 @@ end:
|
||||||
|
|
||||||
static int w1_family_notify(unsigned long action, struct w1_slave *sl)
|
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;
|
int err;
|
||||||
|
|
||||||
fops = sl->family->fops;
|
fops = sl->family->fops;
|
||||||
|
|
|
@ -269,7 +269,7 @@ struct w1_family {
|
||||||
struct list_head family_entry;
|
struct list_head family_entry;
|
||||||
u8 fid;
|
u8 fid;
|
||||||
|
|
||||||
struct w1_family_ops *fops;
|
const struct w1_family_ops *fops;
|
||||||
|
|
||||||
const struct of_device_id *of_match_table;
|
const struct of_device_id *of_match_table;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue