Replace 'kstrdep' with 'kstrdup' in warning messages.
Signed-off-by: Rikard Falkeborn
---
scripts/coccinelle/api/kstrdup.cocci | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/scripts/coccinelle/api/kstrdup.cocci
b/scripts/coccinelle/api
files to create
libtraceevent.a"), and in the trace-cmd repo in 1cdbae6035cei ("Implement
typecasting in parser") when the function was introduced, i.e., it has
always behaved the wrong way.
Detected by cppcheck.
Fixes: f7d82350e597 ("tools/events: Add files to create libtracee
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 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
--- a
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 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 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 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
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
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
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 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 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 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 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 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 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 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
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
>
+ Emil who was working on a patch for this
On Sun, May 31, 2020 at 02:00:45PM +0300, Andy Shevchenko wrote:
> On Sun, May 31, 2020 at 4:11 AM Syed Nayyar Waris
> wrote:
> > On Sat, May 30, 2020 at 2:50 PM Andy Shevchenko
> > wrote:
> > > On Sat, May 30, 2020 at 11:45 AM Syed Nayyar Waris
> >
The only usage of scom_ids is to assign its address to the id_table
field in the fsi_driver struct, which is a const pointer, so make it
const to allow the compiler to put it in read-only memory
Signed-off-by: Rikard Falkeborn
---
drivers/fsi/fsi-scom.c | 2 +-
1 file changed, 1 insertion(+), 1
The only usage of hub_master_ids is to assign its address to the
id_table field in the fsi_driver struct, which is a const pointer, so
make it const to allow the compiler to put it in read-only memory.
Signed-off-by: Rikard Falkeborn
---
drivers/fsi/fsi-master-hub.c | 2 +-
1 file changed, 1
The only usage of sbefifo_ids is to assign its address to the id_table
field in the fsi_driver struct, which is a const pointer, so make it
const to allow the compiler to put it in read-only memory
Signed-off-by: Rikard Falkeborn
---
drivers/fsi/fsi-sbefifo.c | 2 +-
1 file changed, 1 insertion
fsi_device_id is never modified (and it's a const pointer in the
fsi_driver struct), so make the static variables const to allow the
compiler to put them in read-only memory.
Rikard Falkeborn (3):
fsi: master: Constify hub_master_ids
fsi: sbefifo: Constify sbefifo_ids
fsi: scom: Con
On Sun, May 31, 2020 at 02:47:15PM +0100, Jonathan Cameron wrote:
> On Wed, 27 May 2020 04:50:46 +
> "Ardelean, Alexandru" wrote:
>
> > On Tue, 2020-05-26 at 23:02 +0200, Rikard Falkeborn wrote:
> > > [External]
> > >
> > > These a
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
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 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 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/thunderbolt/domain.c | 2 +-
drivers/thunderbolt/switch.c | 2 +-
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/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/fpga/dfl-fme-perf.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions
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
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
> >
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...
ment 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
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
ut 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
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
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
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
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 +-
dri
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
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
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
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
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
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
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 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
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 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 +-
sou
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 '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/arc
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/pci
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
pe
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
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/fsl_imx8_ddr_perf.c | 10 +-
1 file changed, 5 insertions(+), 5
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
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
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
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
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 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
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
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
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
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
On Tue, Oct 08, 2019 at 04:52:17PM +0900, Masahiro Yamada wrote:
> On Tue, Oct 8, 2019 at 4:44 PM Masahiro Yamada
> wrote:
> >
> > Hi Geert,
> >
> > On Tue, Oct 8, 2019 at 4:23 PM Geert Uytterhoeven
> > wrote:
> > >
> > > Hi Rikard,
> &
is was extracted to a
separate patch)
- Updated commit message
Rikard Falkeborn (2):
linux/build_bug.h: Change type to int
linux/bits.h: Add compile time sanity check of GENMASK inputs
include/linux/bits.h | 22 --
include/linux/build_bug.h | 4 ++--
2 files chang
embly. Since BUILD_BUG_OR_ZERO() is not asm compatible, disable the
checks if the file is included in an asm file.
Due to bugs in GCC versions before 4.9 [0], disable the check if
building with a too old GCC compiler.
[0]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19449
Signed-off-by: Rikard Falke
: Masahiro Yamada
Reviewed-by: Kees Cook
Reviewed-by: Masahiro Yamada
Signed-off-by: Rikard Falkeborn
---
Changes in v4:
- Added Kees and Masahiros reviewed-by tags.
Changes in v3:
- This patch is new in v3
include/linux/build_bug.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions
On Sun, Aug 11, 2019 at 08:49:35PM +0200, Rikard Falkeborn wrote:
> Hello,
>
> A new attempt to try to add build time validity checks of GENMASK (and
> GENMASK_ULL) inputs. There main differences from v2:
>
> Remove a define of BUILD_BUG_ON in x86/boot to avoid a compil
7536 192 354168a58 drivers/iio/light/ltr501.o
Signed-off-by: Rikard Falkeborn
---
drivers/iio/light/ltr501.c | 39 +++---
1 file changed, 20 insertions(+), 19 deletions(-)
diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c
index
On Fri, Oct 11, 2019 at 07:27:37PM -0700, Andrew Morton wrote:
> On Wed, 9 Oct 2019 23:45:02 +0200 Rikard Falkeborn
> wrote:
>
> > GENMASK() and GENMASK_ULL() are supposed to be called with the high bit
> > as the first argument and the low bit as the second argument.
Arguments are supposed to be ordered high then low.
Fixes: c173dba44c2d ("ASoC: tas2562: Introduce the TAS2562 amplifier")
Signed-off-by: Rikard Falkeborn
---
Spotted when trying to introduce compile time checking that the order
of the arguments to GENMASK are correct [0]. I have on
Trimming CC-list.
> It'd can't be done as it's used in declarations
> and included in asm files and it uses the UL()
> macro.
Can the BUILD_BUG_ON_ZERO() macro be used instead? It works in
declarations. I don't know if it works in asm-files, but the below
changes builds an x86-64 allyesconfig wit
On Thu, Aug 08, 2019 at 12:46:45PM +0900, Masahiro Yamada wrote:
> On Fri, Aug 2, 2019 at 8:04 AM Rikard Falkeborn
> wrote:
> >
> > Be a little more verbose to improve readability.
> >
> > Signed-off-by: Rikard Falkeborn
>
> BTW, I do not understand what th
le
- Use UL(0) instead of 0
- Extract mask creation in a separate macro to improve readability
- Use high and low instead of h and l (part of this was extracted to a
separate patch)
- Updated commit message
Rikard Falkeborn (3):
x86/boot: Use common BUILD_BUG_ON
linux/build_bug.h: Cha
embly. Since BUILD_BUG_OR_ZERO() is not asm compatible, disable the
checks if the file is included in an asm file.
Signed-off-by: Rikard Falkeborn
---
Changes in v3:
- Changed back to shorter macro argument names
- Remove casts and use 0 instead of UL(0) in GENMASK_INPUT_CHECK(),
since all
: Masahiro Yamada
Signed-off-by: Rikard Falkeborn
---
Changes in v3:
- This patch is new in v3
include/linux/build_bug.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/build_bug.h b/include/linux/build_bug.h
index 0fe5426f2bdc..e3a0be2c90ad 100644
--- a
quot;). At that time, BUILD_BUG_ON was defined in
kernel.h. Presumably BUILD_BUG_ON was redefined to avoid pulling in
kernel.h. Since then, BUILD_BUG_ON and similar macros have been split to
a separate header file.
Signed-off-by: Rikard Falkeborn
---
arch/x86/boot/boot.h | 2 --
arch/x86/boot/m
ot;linux/bits.h: make BIT(), GENMASK(), and friends
available in assembly") made the macros in linux/bits.h available in
assembly. Since neither BUILD_BUG_OR_ZERO() or __is_constexpr() are asm
compatible, disable the checks if the file is included in an asm file.
Signed-off-by: Rikard Falkeborn
--
On Wed, Jul 31, 2019 at 12:27:38PM -0700, Joe Perches wrote:
> On Wed, 2019-07-31 at 21:03 +0200, Rikard Falkeborn wrote:
> > GENMASK() and GENMASK_ULL() are supposed to be called with the high bit
> > as the first argument and the low bit as the second argument. Mixing
> > th
Be a little more verbose to improve readability.
Signed-off-by: Rikard Falkeborn
---
Changes in v2:
- This patch is new in v2
include/linux/bits.h | 16
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/linux/bits.h b/include/linux/bits.h
index
On Wed, Jul 31, 2019 at 07:57:48PM -0700, Joe Perches wrote:
> On Thu, 2019-08-01 at 11:50 +0900, Masahiro Yamada wrote:
> > On Thu, Aug 1, 2019 at 4:04 AM Rikard Falkeborn
> > wrote:
> > > GENMASK() and GENMASK_ULL() are supposed to be called with the high bit
> > &
cks if the file is included in an asm file.
Signed-off-by: Rikard Falkeborn
---
Changes in v2:
- Add comment about why inputs are not checked when used in asm file
- Use UL(0) instead of 0
- Extract mask creation in a separate macro to improve readability
- Use high and low instead of h and
ations, BUILD_BUG_OR_ZERO() must be
> > > > > used instead of BUILD_BUG_ON(), and __is_constexpr() must be used
> > > > > instead
> > > > > of __builtin_constant_p().
> > > > >
> > > > > Commit 95b980d62d52 ("linux/
On Sat, Aug 03, 2019 at 12:12:46PM +0900, Masahiro Yamada wrote:
> On Sat, Aug 3, 2019 at 12:03 PM Masahiro Yamada
> wrote:
>
> >
> > BTW, v2 is already inconsistent.
> > If you wanted GENMASK_INPUT_CHECK() to return 'unsigned long',,
> > you would have to cast (low) > (high) as well:
> >
> >
1 - 100 of 284 matches
Mail list logo