Skip to content

drivers/mfd: Constify static attribute_group structs

Rikard Falkeborn lkml 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v1 Latest posting 2/23 patches 0 repliesNew
  2. v1 posting 1/23 patches 0 repliesSuperseded

Patches in v1 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3mfd: gateworks-gsc: Constify static struct attribute_groupdrivers/mfd/gateworks-gsc.c+1 -10 replies
2/3mfd: lm3533: Constify static struct attribute_groupdrivers/mfd/lm3533-core.c+1 -10 replies
3/3mfd: pcf50633: Constify static struct attribute_groupdrivers/mfd/pcf50633-core.c+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RESEND PATCH 0/3] drivers/mfd: Constify static attribute_group structs

Seems the first submission somehow didn't make it to LKML, here's a resend.

The only usage of the structs is to pass their address to sysfs_create_group() and sysfs_remove_group(), both which takes pointers to const attribute_group structs. Make them const to allow the compiler to put them in read-only memory.

Done with the help of coccinelle.

With these patches applied, all static attribute_group structs in drivers/mfd are const.

Rikard Falkeborn (3):
mfd: gateworks-gsc: Constify static struct attribute_group
mfd: lm3533: Constify static struct attribute_group
mfd: pcf50633: Constify static struct attribute_group

 drivers/mfd/gateworks-gsc.c | 2 +-
 drivers/mfd/lm3533-core.c   | 2 +-
 drivers/mfd/pcf50633-core.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.30.1