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...
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
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
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
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
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
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
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
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
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
>
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
, 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
> >
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
-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
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
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
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
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
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
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
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
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
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
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_
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
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
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
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
.
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
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
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
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
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
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
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
-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
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
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
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
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
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 - 100 of 284 matches
Mail list logo