Skip to content

w1: Constify w1_family_ops

Rikard Falkeborn linux-pm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3w1: Constify struct w1_family_opsdrivers/w1/w1.c include/linux/w1.h+2 -21 reply
2/3w1: Constify static w1_family_ops structsdrivers/w1/slaves/w1_ds2405.c drivers/w1/slaves/w1_ds2406.c drivers/w1/slaves/w1_ds2408.c +14 more+19 -190 replies
3/3power: supply: Constify static w1_family_ops structsdrivers/power/supply/bq27xxx_battery_hdq.c drivers/power/supply/ds2760_battery.c drivers/power/supply/max1721x_battery.c+3 -31 reply

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchSebastian Reichel
1/3R-b
2/3
3/3A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] w1: Constify w1_family_ops

None of the current instances of struct w1_family_ops in the kernel is modified. Constify these to let the compiler put them in read-only memory.

The first patch changes the fops field in w1_family struct to a pointer to const and makes a local variable a pointer to const to avoid a compiler warning. This patch is a prerequisite for the second and third patches which constifies the static structs in drivers in w1 and power. These changes was done with coccinelle (details in the commit messages).

With these changes applied, all instances of struct w1_family_ops in the kernel are const.

Build-tested on x86 allmodconfig.

Rikard Falkeborn (3):
w1: Constify struct w1_family_ops
w1: Constify static w1_family_ops structs
power: supply: Constify static w1_family_ops structs

 drivers/power/supply/bq27xxx_battery_hdq.c | 2 +-
 drivers/power/supply/ds2760_battery.c      | 2 +-
 drivers/power/supply/max1721x_battery.c    | 2 +-
 drivers/w1/slaves/w1_ds2405.c              | 2 +-
 drivers/w1/slaves/w1_ds2406.c              | 2 +-
 drivers/w1/slaves/w1_ds2408.c              | 2 +-
 drivers/w1/slaves/w1_ds2413.c              | 2 +-
 drivers/w1/slaves/w1_ds2423.c              | 2 +-
 drivers/w1/slaves/w1_ds2430.c              | 2 +-
 drivers/w1/slaves/w1_ds2431.c              | 2 +-
 drivers/w1/slaves/w1_ds2433.c              | 2 +-
 drivers/w1/slaves/w1_ds2438.c              | 2 +-
 drivers/w1/slaves/w1_ds250x.c              | 2 +-
 drivers/w1/slaves/w1_ds2780.c              | 2 +-
 drivers/w1/slaves/w1_ds2781.c              | 2 +-
 drivers/w1/slaves/w1_ds2805.c              | 2 +-
 drivers/w1/slaves/w1_ds28e04.c             | 2 +-
 drivers/w1/slaves/w1_ds28e17.c             | 2 +-
 drivers/w1/slaves/w1_therm.c               | 6 +++---
 drivers/w1/w1.c                            | 4 ++--
 include/linux/w1.h                         | 2 +-
 21 files changed, 24 insertions(+), 24 deletions(-)
Signature · 1 line
2.28.0