[PATCH v2] mfd: stmpe: Revert "Constify static struct resource"

2021-03-04 Thread Rikard Falkeborn
stmpe: Constify static struct resource") Reported-by: Andy Shevchenko Signed-off-by: Rikard Falkeborn --- Changes V1-V2: Add comments to the structs that they are dynamically modified Rewrite commit message. V1: https://lore.kernel.org/lkml/20210302234710.74455-1-rikard.falkeb...

[PATCH] mfd: stmpe: Revert "Constify static struct resource"

2021-03-03 Thread Rikard Falkeborn
8d7b3a6dac4eae22c58b0853696cbd256966741b. Fixes: 8d7b3a6dac4e ("mfd: stmpe: Constify static struct resource") Cc: Andy Shevchenko Signed-off-by: Rikard Falkeborn --- I went through the series and this was the only additional issue I found. Sorry about that. drivers/mfd/stmpe.c | 10 +- 1 fi

[RESEND PATCH 2/3] mfd: lm3533: Constify static struct attribute_group

2021-03-02 Thread Rikard Falkeborn
The only usage of lm3533_attribute_group is to pass its address to sysfs_create_group() and sysfs_remove_group(), both which takes pointers to const attribute_group structs. Make it const to allow the compiler to put it in read-only memory. Done with the help of coccinelle. Signed-off-by: Rikard

[RESEND PATCH 3/3] mfd: pcf50633: Constify static struct attribute_group

2021-03-02 Thread Rikard Falkeborn
The only usage of pcf_attr_group is to pass its address to sysfs_create_group() and sysfs_remove_group(), both which takes pointers to const attribute_group structs. Make it const to allow the compiler to put it in read-only memory. Done with the help of coccinelle. Signed-off-by: Rikard

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

2021-03-02 Thread Rikard Falkeborn
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

[RESEND PATCH 1/3] mfd: gateworks-gsc: Constify static struct attribute_group

2021-03-02 Thread Rikard Falkeborn
The only usage of attr_group is to pass its address to sysfs_create_group() and sysfs_remove_group(), both which takes pointers to const attribute_group structs. Make it const to allow the compiler to put it in read-only memory. Done with the help of coccinelle. Signed-off-by: Rikard Falkeborn

Re: [PATCH v1 1/5] mfd: intel_quark_i2c_gpio: revert "Constify static struct resources"

2021-03-02 Thread Rikard Falkeborn
d a comment to avoid similar changes in the future. > > Fixes: c4a164f41554 ("mfd: Constify static struct resources") > Cc: Rikard Falkeborn > Signed-off-by: Andy Shevchenko > --- > drivers/mfd/intel_quark_i2c_gpio.c | 6 -- > 1 file changed, 4 insertions(+), 2 del

Re: [PATCH] tpm: Remove unintentional dump_stack() call

2021-03-01 Thread Rikard Falkeborn
On Mon, Mar 01, 2021 at 11:44:09AM +0200, jar...@kernel.org wrote: > From: Jarkko Sakkinen > > Somewhere along the line, probably during a rebase, an unintentional > dump_stack() got included. Revert this change. > > Reported-by: Rikard Falkeborn > Fixes: 90cba8d20f8

Re: [PATCH 1/3] mfd: gateworks-gsc: Constify static struct attribute_group

2021-03-01 Thread Rikard Falkeborn
On Mon, Mar 01, 2021 at 09:56:45AM +, Lee Jones wrote: > On Sun, 31 Jan 2021, Rikard Falkeborn wrote: > > > The only usage of attr_group is to pass its address to > > sysfs_create_group() and sysfs_remove_group(), both which takes pointers > > to const attribute_grou

Re: [PATCH] tpm/ppi: Constify static struct attribute_group

2021-02-26 Thread Rikard Falkeborn
On Fri, Feb 05, 2021 at 04:04:18AM +0200, Jarkko Sakkinen wrote: > On Thu, Feb 04, 2021 at 10:54:27PM +0100, Rikard Falkeborn wrote: > > The only usage of ppi_attr_grp is to put its address in an array of > > pointers to const struct attribute_group. Make it const to allow the >

[PATCH 1/4] ASoC: rt*: Constify static struct sdw_slave_ops

2021-02-24 Thread Rikard Falkeborn
The only usage of these is to assign their address to the ops field in the sdw_driver struct, which is a pointer to const. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- sound/soc/codecs/rt1308-sdw.c | 2 +- sound/soc/codecs/rt5682

[PATCH 2/4] ASoC: rt*: Constify static struct snd_soc_dai_ops

2021-02-24 Thread Rikard Falkeborn
The only usage of them is to assign their address to the ops field in the snd_soc_dai_driver struct, which is a pointer to const. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- sound/soc/codecs/rt1015.c | 2 +- sound/soc/codecs

[PATCH 3/4] ASoC: rt*: Constify static struct acpi_device_id

2021-02-24 Thread Rikard Falkeborn
These are never modified, so make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- sound/soc/codecs/rt1011.c | 2 +- sound/soc/codecs/rt1015.c | 2 +- sound/soc/codecs/rt1016.c | 2 +- sound/soc/codecs/rt1305.c | 2 +- sound/soc/codecs/rt1308

[PATCH 4/4] ASoc: rt5631: Constify static struct coeff_clk_div

2021-02-24 Thread Rikard Falkeborn
coeff_div is only read from, so make it const to show the intent. Signed-off-by: Rikard Falkeborn --- sound/soc/codecs/rt5631.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/rt5631.c b/sound/soc/codecs/rt5631.c index 653da3eaf355..afc1305a7fa5 100644

[PATCH 0/4] ASoC: rt*: Constify static structs

2021-02-24 Thread Rikard Falkeborn
there. When doing this, I discovered sound/soc/codecs/rt1016.c is not in a Makefile, so there is not really any way to build it (I added locally to the Makefile to compile-test my changes). Is this expected or an oversight? Rikard Falkeborn (4): ASoC: rt*: Constify static struct sdw_slave_ops

[PATCH 3/3] drm/nouveau/ttm: constify static vm_operations_struct

2021-02-09 Thread Rikard Falkeborn
The only usage of nouveau_ttm_vm_ops is to assign its address to the vm_ops field in the vm_area_struct struct. Make it const to allow the compiler to put it in read-only memory Signed-off-by: Rikard Falkeborn --- drivers/gpu/drm/nouveau/nouveau_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 0/3] drm/ttm: constify static vm_operations_structs

2021-02-09 Thread Rikard Falkeborn
applied, all static struct vm_operations_struct in the kernel tree are const. Rikard Falkeborn (3): drm/amdgpu/ttm: constify static vm_operations_struct drm/radeon/ttm: constify static vm_operations_struct drm/nouveau/ttm: constify static vm_operations_struct drivers/gpu/drm/amd/amdgpu

[PATCH 2/3] drm/radeon/ttm: constify static vm_operations_struct

2021-02-09 Thread Rikard Falkeborn
The only usage of radeon_ttm_vm_ops is to assign its address to the vm_ops field in the vm_area_struct struct. Make it const to allow the compiler to put it in read-only memory Signed-off-by: Rikard Falkeborn --- drivers/gpu/drm/radeon/radeon_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 1/3] drm/amdgpu/ttm: constify static vm_operations_struct

2021-02-09 Thread Rikard Falkeborn
The only usage of amdgpu_ttm_vm_ops is to assign its address to the vm_ops field in the vm_area_struct struct. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH] PCI: tegra: Constify static structs

2021-02-07 Thread Rikard Falkeborn
The only usage of them is to assign their address to the 'ops' field in the pcie_port and the dw_pcie_ep structs, both which are pointers to const. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/pci/controller/dwc/pcie-tegra194

[PATCH] staging: fieldbus: arcx-anybus: constify static structs

2021-02-07 Thread Rikard Falkeborn
to the 'ops' field in the regulator_desc struct, which is a pointer to const struct regulator_ops. Signed-off-by: Rikard Falkeborn --- drivers/staging/fieldbus/anybuss/arcx-anybus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/fieldbus/anybuss/arcx-anybus.c

[PATCH] Platform: OLPC: Constify static struct regulator_ops

2021-02-06 Thread Rikard Falkeborn
The only usage of it is to assign its address to the ops field in the regulator_desc struct, which is a pointer to const struct regulator_ops. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/platform/olpc/olpc-ec.c | 2 +- 1 file

[PATCH] ASoC: fsl: constify static snd_soc_dai_ops structs

2021-02-06 Thread Rikard Falkeborn
The only usage of these is to assign their address to the 'ops' field in the snd_soc_dai_driver struct, which is a pointer to const. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- sound/soc/fsl/fsl_easrc.c | 2 +- sound/soc/fsl

[PATCH] media: usbtv: constify static structs

2021-02-06 Thread Rikard Falkeborn
of usbtv_ioctl_ops is to put its address to the ioctl_ops field in the video_device struct. Making it const moves ~1kb to read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/media/usb/usbtv/usbtv-video.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/usb

[PATCH] tpm/ppi: Constify static struct attribute_group

2021-02-04 Thread Rikard Falkeborn
The only usage of ppi_attr_grp is to put its address in an array of pointers to const struct attribute_group. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/char/tpm/tpm_ppi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] intel_th: Constify attribute_group structs

2021-02-04 Thread Rikard Falkeborn
The only usage of them is to pass their address to sysfs_create_group() and sysfs_remove_group(), both which have pointers to const attribute_group structs as input. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/hwtracing

[PATCH] mm/swap_state: Constify static struct attribute_group

2021-02-01 Thread Rikard Falkeborn
The only usage of swap_attr_group is to pass its address to sysfs_create_group() which takes a pointer to const attribute_group. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn --- mm/swap_state.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH] PM: Constify static struct attribute_group

2021-02-01 Thread Rikard Falkeborn
The only usage of suspend_attr_group is to put its address in an array of pointers to const attribute_group structs. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn --- kernel/power/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] arm64: perf: Constify static attribute_group structs

2021-01-31 Thread Rikard Falkeborn
The only usage of these is to put their addresses in an array of pointers to const attribute_group structs. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- arch/arm64/kernel/perf_event.c | 6 +++--- 1 file changed, 3 insertions(+), 3

[PATCH 2/3] mfd: lm3533: Constify static struct attribute_group

2021-01-31 Thread Rikard Falkeborn
The only usage of lm3533_attribute_group is to pass its address to sysfs_create_group() and sysfs_remove_group(), both which takes pointers to const attribute_group structs. Make it const to allow the compiler to put it in read-only memory. Done with the help of coccinelle. Signed-off-by: Rikard

[PATCH 1/3] mfd: gateworks-gsc: Constify static struct attribute_group

2021-01-31 Thread Rikard Falkeborn
The only usage of attr_group is to pass its address to sysfs_create_group() and sysfs_remove_group(), both which takes pointers to const attribute_group structs. Make it const to allow the compiler to put it in read-only memory. Done with the help of coccinelle. Signed-off-by: Rikard Falkeborn

[PATCH 3/3] mfd: pcf50633: Constify static struct attribute_group

2021-01-31 Thread Rikard Falkeborn
The only usage of pcf_attr_group is to pass its address to sysfs_create_group() and sysfs_remove_group(), both which takes pointers to const attribute_group structs. Make it const to allow the compiler to put it in read-only memory. Done with the help of coccinelle. Signed-off-by: Rikard

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

2021-01-31 Thread Rikard Falkeborn
, 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

[PATCH 1/2] ALSA: ac97: Constify static struct attribute_group

2021-01-30 Thread Rikard Falkeborn
The only usage of ac97_adapter_attr_group is to put its address in an array of pointers to const attribute_group structs. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn --- sound/ac97/bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH 0/2] ALSA: Constify static attribute_group structs

2021-01-30 Thread Rikard Falkeborn
Constify two static attribute_group structs that are never modified. These two were the only static non-const ones in sound/. Rikard Falkeborn (2): ALSA: ac97: Constify static struct attribute_group ALSA: hda: Constify static attribute_group sound/ac97/bus.c | 2 +- sound/hda

[PATCH 2/2] ALSA: hda: Constify static attribute_group

2021-01-30 Thread Rikard Falkeborn
The only usage of hdac_dev_attr_group is to put its address in an array of pointers to const attribute_group structs. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn --- sound/hda/hdac_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH V2] soundwire: sysfs: Constify static struct attribute_group

2021-01-17 Thread Rikard Falkeborn
with the help of Coccinelle. Signed-off-by: Rikard Falkeborn --- Changes since v 1: Fix spelling in commit message title (sorry for the noise...) drivers/soundwire/sysfs_slave.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soundwire/sysfs_slave.c b/drivers/soundwire

[PATCH] soundwire: sysfs: Constiyf static struct attribute_group

2021-01-17 Thread Rikard Falkeborn
with the help of Coccinelle. Signed-off-by: Rikard Falkeborn --- drivers/soundwire/sysfs_slave.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soundwire/sysfs_slave.c b/drivers/soundwire/sysfs_slave.c index b48b6617a396..3210359cd944 100644 --- a/drivers/soundwire

[PATCH 2/4] perf/imx_ddr: Constify static struct attribute_group

2021-01-17 Thread Rikard Falkeborn
The only usage is to put their addresses in an array of pointers to const struct attribute group. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/perf/fsl_imx8_ddr_perf.c | 10 +- 1 file changed, 5 insertions(+), 5

[PATCH 1/4] perf: qcom: Constify static struct attribute_group

2021-01-17 Thread Rikard Falkeborn
The only usage is to put their addresses in an array of pointers to const struct attribute group. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/perf/qcom_l2_pmu.c | 6 +++--- drivers/perf/qcom_l3_pmu.c | 6 +++--- 2 files

[PATCH 3/4] perf: hisi: Constify static struct attribute_group

2021-01-17 Thread Rikard Falkeborn
The only usage is to put their addresses in an array of pointers to const struct attribute group. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c | 2 +- drivers/perf/hisilicon

[PATCH 4/4] perf: Constify static struct attribute_group

2021-01-17 Thread Rikard Falkeborn
The only usage is to put their addresses in an array of pointers to const struct attribute group. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/perf/arm-cci.c| 2 +- drivers/perf/arm-cmn.c| 2 +- drivers/perf

[PATCH 0/4] drivers/perf: Constify static struct attribute_group

2021-01-17 Thread Rikard Falkeborn
are modified at runtime and can't be const). Patches are independent and split based on output from get_maintainers.pl. I can of course split differently if that's desired. Done with the help of coccinelle. Rikard Falkeborn (4): perf: qcom: Constify static struct attribute_group perf/imx_ddr

[PATCH 0/2] power: supply: Constify static struct attribute_group

2021-01-13 Thread Rikard Falkeborn
Constify two static struct attribute_group. The only place they are used is to put their address in an array of pointers to const struct attribute_group. With these patches applied, all static attribute_group structs in drivers/power are const. Rikard Falkeborn (2): power: supply: ltc4162-l

[PATCH 1/2] power: supply: ltc4162-l: Constify static struct attribute_group

2021-01-13 Thread Rikard Falkeborn
The only usage of it is to put its address in an array of pointers to const static structs. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/power/supply/ltc4162-l-charger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH 2/2] power: supply: core: Constify static struct attribute_group

2021-01-13 Thread Rikard Falkeborn
The only usage of it is to put its address in an array of pointers to const static structs. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/power/supply/power_supply_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

Re: [PATCH] fpga: dfl: fme: Constify static attribute_group structs

2021-01-09 Thread Rikard Falkeborn
On Sat, Jan 09, 2021 at 01:55:13PM -0800, Tom Rix wrote: > > On 1/8/21 3:54 PM, Rikard Falkeborn wrote: > > The only usage of these is to put their addresses in arrays of pointers > > to const attribute_groups. Make them const to allow the compiler to put > >

[PATCH] platform/chrome: Constify static attribute_group structs

2021-01-08 Thread Rikard Falkeborn
The only usage of these is to print their name in a dev_err-message, and to pass their address to sysfs_create_group() and sysfs_remove_group(), both which takes pointers to const. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers

[PATCH] fpga: dfl: fme: Constify static attribute_group structs

2021-01-08 Thread Rikard Falkeborn
The only usage of these is to put their addresses in arrays of pointers to const attribute_groups. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/fpga/dfl-fme-perf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions

[PATCH] nvme: Constify static attribute_group structs

2021-01-08 Thread Rikard Falkeborn
The only usage of these is to put their addresses in arrays of pointers to const attribute_groups. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/nvme/host/core.c | 4 ++-- drivers/nvme/host/fc.c | 2 +- drivers/nvme

[PATCH] thunderbolt: Constify static attribute_group structs

2021-01-08 Thread Rikard Falkeborn
The only usage of these is to put their addresses in arrays of pointers to const attribute_groups. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/thunderbolt/domain.c | 2 +- drivers/thunderbolt/switch.c | 2 +- drivers

[PATCH] 9p: Constify static struct v9fs_attr_group

2021-01-08 Thread Rikard Falkeborn
The only usage of v9fs_attr_group is to pass its address to sysfs_create_group() and sysfs_create_group(), both which takes pointers to const struct attribute_group. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn --- fs/9p/v9fs.c | 2 +- 1

[PATCH] most: core: Constify static attribute_group structs

2021-01-08 Thread Rikard Falkeborn
The only usage of these is to put their addresses in arrays of pointers to const attribute_groups. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/most/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff

[PATCH] thermal: Constify static attribute_group structs

2020-11-28 Thread Rikard Falkeborn
The only usage of these structs is to assign their address to the thermal_zone_attribute_groups array, which consists of pointers to const, so make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/thermal/thermal_sysfs.c | 6 +++--- 1

[PATCH 3/3] usb: common: ulpi: Constify static attribute_group struct

2020-11-25 Thread Rikard Falkeborn
It is never modified, so make them const to allow the compiler to put it in read-only memory. Done with the help of coccinelle. Signed-off-by: Rikard Falkeborn --- drivers/usb/common/ulpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/common/ulpi.c b/drivers

[PATCH 2/3] usb: typec: Constify static attribute_group structs

2020-11-25 Thread Rikard Falkeborn
These are never modified, so make them const to allow the compiler to put them in read-only memory. Done with the help of coccinelle. Signed-off-by: Rikard Falkeborn --- drivers/usb/typec/class.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/typec

[PATCH 1/3] USB: core: Constify static attribute_group structs

2020-11-25 Thread Rikard Falkeborn
These are never modified, so make them const to allow the compiler to put them in read-only memory. Done with the help of coccinelle. Signed-off-by: Rikard Falkeborn --- drivers/usb/core/endpoint.c | 2 +- drivers/usb/core/port.c | 4 ++-- drivers/usb/core/sysfs.c| 14

[PATCH 0/3] drivers/usb: Constify static attribute_group structs

2020-11-25 Thread Rikard Falkeborn
applied, all static struct attribute_group in drivers/usb are const. Done with the help of coccinelle. Rikard Falkeborn (3): USB: core: Constify static attribute_group structs usb: typec: Constify static attribute_group structs usb: common: ulpi: Constify static attribute_group struct drivers

[PATCH] HID: wacom: Constify attribute_groups

2020-11-24 Thread Rikard Falkeborn
3c7e9 drivers/hid/wacom_old.ko 204240 42064 576 246880 3c460 drivers/hid/wacom_new.ko Signed-off-by: Rikard Falkeborn --- drivers/hid/wacom_sys.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index

[PATCH] samples: qmi: Constify static qmi ops

2020-11-24 Thread Rikard Falkeborn
The only usage of qmi_sample_handlers[] and lookup_ops is to pass their addresses to qmi_handle_init() which accepts const pointers to both qmi_ops and qmi_msg_handler. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- samples/qmi

[PATCH] remoteproc: qcom_sysmon: Constify qmi_indication_handler

2020-11-22 Thread Rikard Falkeborn
The only usage of qmi_indication_handler[] is to pass its address to qmi_handle_init() which accepts a const pointer. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/remoteproc/qcom_sysmon.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH] slimbus: qcom-ngd-ctrl: Constify static structs

2020-11-22 Thread Rikard Falkeborn
qcom_slim_qmi_msg_handlers[] and qcom_slim_ngd_qmi_svc_event_ops are only used as input arguments to qmi_handle_init() which accepts const pointers to both qmi_ops and qmi_msg_handler. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn

[PATCH net-next 2/2] ath10k: Constify static qmi structs

2020-11-22 Thread Rikard Falkeborn
qmi_msg_handler[] and ath10k_qmi_ops are only used as input arguments to qmi_handle_init() which accepts const pointers to both qmi_ops and qmi_msg_handler. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/net/wireless/ath/ath10k

[PATCH net-next 0/2] net: Constify static qmi structs

2020-11-22 Thread Rikard Falkeborn
Constify a couple of static qmi_ops and qmi_msg_handler structs that are never modified. Rikard Falkeborn (2): soc: qcom: ipa: Constify static qmi structs ath10k: Constify static qmi structs drivers/net/ipa/ipa_qmi.c | 8 drivers/net/wireless/ath/ath10k/qmi.c | 4

[PATCH net-next 1/2] soc: qcom: ipa: Constify static qmi structs

2020-11-22 Thread Rikard Falkeborn
These are only used as input arguments to qmi_handle_init() which accepts const pointers to both qmi_ops and qmi_msg_handler. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/net/ipa/ipa_qmi.c | 8 1 file changed, 4

[PATCH] soc: qcom: pdr: Constify static qmi structs

2020-11-22 Thread Rikard Falkeborn
Their only usage is to pass their address to qmi_handle_init() which accepts const pointers to both qmi_ops and qmi_msg_handler. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/soc/qcom/pdr_interface.c | 6 +++--- 1 file changed

[PATCH] dm crypt: Constify static crypt_iv_operations

2020-11-21 Thread Rikard Falkeborn
The only usage of these structs is to assign their address to the iv_gen_ops field in the crypt config struct, which is a pointer to const. Make them const like the rest of the static crypt_iv_operations structs. This allows the compiler to put them in read-only memory. Signed-off-by: Rikard

[PATCH rdma-next] RDMA/i40iw: Constify ops structs

2020-11-20 Thread Rikard Falkeborn
The ops structs are never modified. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/infiniband/hw/i40iw/i40iw_ctrl.c | 20 ++-- drivers/infiniband/hw/i40iw/i40iw_type.h | 20 ++-- 2 files changed

[PATCH] ALSA: aloop: Constify ops structs

2020-11-20 Thread Rikard Falkeborn
The only usage of the ops field in the loopback_cable struct is to call its members, the field it self is never changed. Make it a pointer to const. This allows us to constify two static loopback_ops structs to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn

[PATCH] media: i2c: rdacm20: Constify static structs

2020-11-19 Thread Rikard Falkeborn
to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/media/i2c/rdacm20.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/rdacm20.c b/drivers/media/i2c/rdacm20.c index 1ed928c4ca70..ac00a6743623 100644 --- a/drivers/media/i2c/rdacm20.c

[PATCH] media: rockchip: rkisp1: Constify static structs

2020-11-19 Thread Rikard Falkeborn
These 'ops' structs are never modified, so make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c | 6 +++--- drivers/media/platform/rockchip/rkisp1/rkisp1-common.h | 2 +- drivers/media

[tip: x86/cache] x86/resctrl: Constify kernfs_ops

2020-11-19 Thread tip-bot2 for Rikard Falkeborn
The following commit has been merged into the x86/cache branch of tip: Commit-ID: 2002d2951398317d0f46e64ae6d8dd58ed541c6d Gitweb: https://git.kernel.org/tip/2002d2951398317d0f46e64ae6d8dd58ed541c6d Author:Rikard Falkeborn AuthorDate:Wed, 11 Nov 2020 00:02:28 +01:00

[PATCH] x86/resctrl: Constify kernfs_ops

2020-11-10 Thread Rikard Falkeborn
-only memory. Signed-off-by: Rikard Falkeborn --- arch/x86/kernel/cpu/resctrl/internal.h | 2 +- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h index

[PATCH] pinctrl: renesas: Constify sh73a0_vccq_mc0_ops

2020-11-09 Thread Rikard Falkeborn
The only usage of sh73a0_vccq_mc0_ops is to assign its address to the ops field in the regulator_desc struct, which is a const pointer. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/pinctrl/renesas/pfc-sh73a0.c | 2 +- 1 file

[PATCH] phy: tegra: Constify static device_type structs

2020-11-09 Thread Rikard Falkeborn
The only usage of tegra_xusb_pad_type and tegra_xusb_port_type is to assign their address to the type field in the device struct, which is a const pointer. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/phy/tegra/xusb.c | 4

[PATCH] drm/msm: dsi: Constify dsi_host_ops

2020-11-08 Thread Rikard Falkeborn
The only usage of dsi_host_ops is to assign its address to the ops field in the mipi_dsi_host struct, which is a const pointer. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +- 1 file changed, 1

[PATCH 2/2] remoteproc: stm32: Constify st_rproc_ops

2020-11-07 Thread Rikard Falkeborn
The only usage of st_rproc_ops is to pass its address to rproc_alloc() which accepts a const pointer. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/remoteproc/stm32_rproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH 0/2] remoteproc: Constify static struct rproc_ops

2020-11-07 Thread Rikard Falkeborn
Constify two static struct rproc_ops which are never modified. These two changes makes all static instances of rproc_ops in the kernel const. Rikard Falkeborn (2): remoteproc: ingenic: Constify ingenic_rproc_ops remoteproc: stm32: Constify st_rproc_ops drivers/remoteproc/ingenic_rproc.c | 2

[PATCH 1/2] remoteproc: ingenic: Constify ingenic_rproc_ops

2020-11-07 Thread Rikard Falkeborn
The only usage of ingenic_rproc_ops is to pass its address to devm_rproc_alloc(), which accepts a const pointer. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/remoteproc/ingenic_rproc.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH] tty: serial: msm_serial: Constify msm_uart_pops

2020-11-04 Thread Rikard Falkeborn
The only usage of msm_uart_pops is to assign its address to the ops field in the uart_port struct, which is a pointer to const. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/tty/serial/msm_serial.c | 2 +- 1 file changed, 1

[PATCH net-next v2 1/2] mptcp: Constify mptcp_pm_ops

2020-10-04 Thread Rikard Falkeborn
The only usages of mptcp_pm_ops is to assign its address to the small_ops field of the genl_family struct, which is a const pointer, and applying ARRAY_SIZE() on it. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn --- net/mptcp/pm_netlink.c | 2

[PATCH net-next v2 2/2] net: openvswitch: Constify static struct genl_small_ops

2020-10-04 Thread Rikard Falkeborn
The only usage of these is to assign their address to the small_ops field in the genl_family struct, which is a const pointer, and applying ARRAY_SIZE() on them. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- net/openvswitch

[PATCH net-next v2 0/2] net: Constify struct genl_small_ops

2020-10-04 Thread Rikard Falkeborn
Make a couple of static struct genl_small_ops const to allow the compiler to put them in read-only memory. Patches are independent. v2: Rebase on net-next, genl_ops -> genl_small_ops Rikard Falkeborn (2): mptcp: Constify mptcp_pm_ops net: openvswitch: Constify static struct genl_small_

[PATCH net-next 0/2] net: Constify struct genl_ops

2020-10-04 Thread Rikard Falkeborn
Make a couple of static struct genl_ops const to allow the compiler to put them in read-only memory. Patches are independent. Rikard Falkeborn (2): mptcp: Constify mptcp_pm_ops net: openvswitch: Constify static struct genl_ops net/mptcp/pm_netlink.c | 2 +- net/openvswitch/conntrack.c

[PATCH net-next 1/2] mptcp: Constify mptcp_pm_ops

2020-10-04 Thread Rikard Falkeborn
The only usages of mptcp_pm_ops is to assign its address to the ops field of the genl_family struct, which is a const pointer, and applying ARRAY_SIZE() on it. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn --- net/mptcp/pm_netlink.c | 2 +- 1

[PATCH net-next 2/2] net: openvswitch: Constify static struct genl_ops

2020-10-04 Thread Rikard Falkeborn
The only usage of these is to assign their address to the ops field in the genl_family struct, which is a const pointer, and applying ARRAY_SIZE() on them. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- net/openvswitch/conntrack.c | 2

[PATCH] drm: bridge: dw-hdmi: Constify dw_hdmi_i2s_ops

2020-10-04 Thread Rikard Falkeborn
The only usage of dw_hdmi_i2s_ops is to assign its address to the ops field in the hdmi_codec_pdata struct, which is a const pointer. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c | 2

[PATCH 0/3] w1: Constify w1_family_ops

2020-10-04 Thread Rikard Falkeborn
. 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

[PATCH 2/3] w1: Constify static w1_family_ops structs

2020-10-04 Thread Rikard Falkeborn
optional_qualifier@ identifier r1.i; @@ static +const struct w1_family_ops i={}; // Signed-off-by: Rikard Falkeborn --- 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

[PATCH 3/3] power: supply: Constify static w1_family_ops structs

2020-10-04 Thread Rikard Falkeborn
optional_qualifier@ identifier r1.i; @@ static +const struct w1_family_ops i={}; // Signed-off-by: Rikard Falkeborn --- drivers/power/supply/bq27xxx_battery_hdq.c | 2 +- drivers/power/supply/ds2760_battery.c | 2 +- drivers/power/supply/max1721x_battery.c| 2 +- 3 files changed, 3 insertions(+), 3

[PATCH 1/3] w1: Constify struct w1_family_ops

2020-10-04 Thread Rikard Falkeborn
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. Signed-off-by: Rikard Falkeborn

[PATCH] iio: accel: mma8452: Constify static struct attribute_group

2020-09-30 Thread Rikard Falkeborn
The only usage of mma8452_event_attribute_group is to assign its address to the event_attrs field in the iio_info struct, which is a const pointer. Make it const to allow the compiler to put it in read-only memory. This was the only non-const static struct in drivers/iio. Signed-off-by: Rikard

[PATCH rdma-next 2/2] RDMA/rtrs: Constify static struct attribute_group

2020-09-30 Thread Rikard Falkeborn
The only usage of these is to pass their address to sysfs_create_group() and sysfs_remove_group(), both which takes const pointers. Make the const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/infiniband/ulp/rtrs/rtrs-clt-sysfs.c | 6

[PATCH rdma-next 0/2] RDMA: Constify static struct attribute_group

2020-09-30 Thread Rikard Falkeborn
Constify a couple of static struct attribute_group that are never modified to allow the compiler to put them in read-only memory. Rikard Falkeborn (2): RDMA/core: Constify struct attribute_group RDMA/rtrs: Constify static struct attribute_group drivers/infiniband/core/sysfs.c

[PATCH rdma-next 1/2] RDMA/core: Constify struct attribute_group

2020-09-30 Thread Rikard Falkeborn
-by: Rikard Falkeborn --- drivers/infiniband/core/sysfs.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c index c11e50510e49..453d1c451ed5 100644 --- a/drivers/infiniband/core/sysfs.c +++ b/drivers

[PATCH] regulator: qcom: labibb: Constify static structs

2020-09-30 Thread Rikard Falkeborn
it is only copied into the desc field in the labbibb_regulator_data struct. This struct is modified, but that's a copy of the static one. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/regulator/qcom-labibb-regulator.c | 8 1

[PATCH] ARM: prima2: Constify static sirfsoc_rstc_ops

2020-09-29 Thread Rikard Falkeborn
The only usage of sirfsoc_rstc_ops is to assign its address to the ops field in the reset_controller_dev struct, which is a const pointer. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn --- arch/arm/mach-prima2/rstc.c | 2 +- 1 file changed, 1

[PATCH] atm: atmtcp: Constify atmtcp_v_dev_ops

2020-09-27 Thread Rikard Falkeborn
The only usage of atmtcp_v_dev_ops is to pass its address to atm_dev_register() which takes a pointer to const, and comparing its address to another address, which does not modify it. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers

[PATCH] block/rnbd: client: Constify rnbd_mq_ops

2020-09-27 Thread Rikard Falkeborn
The only usage of rnbd_mq_ops is to assign its address to the ops field in the blk_mq_tag_set struct, which is a const pointer. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/block/rnbd/rnbd-clt.c | 2 +- 1 file changed, 1

[PATCH] phy: fsl-imx8mq-usb: Constify imx8mp_usb_phy_ops

2020-09-26 Thread Rikard Falkeborn
The only usage of imx8mp_usb_phy_ops is to assign its address to the data field in the of_device_id struct, which is a const void pointer. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/phy/freescale/phy-fsl-imx8mq-usb.c | 2 +- 1

  1   2   3   >