From: Julien Stephan <jstephan@baylibre.com>
To: Mudit Sharma <muditsharma.info@gmail.com>,
Jonathan Cameron <jic23@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Anshul Dalal <anshulusr@gmail.com>,
Javier Carrasco <javier.carrasco.cruz@gmail.com>,
Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Cosmin Tanislav <cosmin.tanislav@analog.com>,
Ramona Gradinariu <ramona.gradinariu@analog.com>,
Antoniu Miclaus <antoniu.miclaus@analog.com>,
Dan Robertson <dan@dlrobertson.com>,
Marcelo Schmitt <marcelo.schmitt@analog.com>,
Matteo Martelli <matteomartelli3@gmail.com>,
Anand Ashok Dumbre <anand.ashok.dumbre@xilinx.com>,
Michal Simek <michal.simek@amd.com>,
Mariel Tinaco <Mariel.Tinaco@analog.com>,
Jagath Jog J <jagathjog1996@gmail.com>,
Lorenzo Bianconi <lorenzo@kernel.org>,
Subhajit Ghosh <subhajit.ghosh@tweaklogic.com>,
Kevin Tsai <ktsai@capellamicro.com>,
Linus Walleij <linus.walleij@linaro.org>,
Benson Leung <bleung@chromium.org>,
Guenter Roeck <groeck@chromium.org>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
chrome-platform@lists.linux.dev,
Julien Stephan <jstephan@baylibre.com>,
Julia Lawall <julia.lawall@inria.fr>
Subject: [PATCH 0/7] iio: fix write_event_config signature
Date: Thu, 24 Oct 2024 11:11:22 +0200 [thread overview]
Message-ID: <20241024-iio-fix-write-event-config-signature-v1-0-7d29e5a31b00@baylibre.com> (raw)
Hello,
This series update the write_event_config callback signature to use
a boolean instead of an int for state variable. iio_ev_state_store
is actually using kstrtobool to check user input, then gives the
converted boolean value to write_event_config.
First, fix the write_event_config callbacks from iio drivers that are
checking state input, or that are converting state to bool. This is
useless code, then update signature.
This patch has been partially written using coccinelle with the
following script:
$ cat iio-bool.cocci
// Options: --all-includes
virtual patch
@c1@
identifier iioinfo;
identifier wecfunc;
@@
static const struct iio_info iioinfo = {
...,
.write_event_config =
(
wecfunc
|
&wecfunc
),
...,
};
@@
identifier c1.wecfunc;
identifier indio_dev, chan, type, dir, state;
@@
int wecfunc(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir,
-int
+bool
state) {
...
}
make coccicheck MODE=patch COCCI=iio-bool.cocci M=drivers/iio
Unfortunately, this script didn't match all files:
* all write_event_config callbacks using iio_device_claim_direct_scoped
were not detected and not patched.
* all files that do not assign and declare the write_event_config
callback in the same file.
iio.h was also manually updated.
The patch was build tested using allmodconfig config.
Signed-off-by: Julien Stephan <jstephan@baylibre.com>
---
Julien Stephan (7):
iio: light: bh1745: simplify code in write_event_config callback
iio: light: ltr390: simplify code in write_event_config callback
iio: light: ltr501: simplify code in write_event_config callback
iio: light: veml6030: simplify code in write_event_config callback
iio: imu: inv_mpu6050: simplify code in write_event_config callback
iio: light: stk3310: simplify code in write_event_config callback
iio: fix write_event_config signature
drivers/iio/accel/adxl367.c | 2 +-
drivers/iio/accel/adxl372.c | 2 +-
drivers/iio/accel/adxl380.c | 2 +-
drivers/iio/accel/bma400_core.c | 2 +-
drivers/iio/accel/bmc150-accel-core.c | 2 +-
drivers/iio/accel/fxls8962af-core.c | 2 +-
drivers/iio/accel/kxcjk-1013.c | 2 +-
drivers/iio/accel/mma8452.c | 2 +-
drivers/iio/accel/mma9551.c | 2 +-
drivers/iio/accel/mma9553.c | 3 +-
drivers/iio/accel/sca3000.c | 2 +-
drivers/iio/adc/ad7091r-base.c | 3 +-
drivers/iio/adc/ad7291.c | 2 +-
drivers/iio/adc/ad799x.c | 2 +-
drivers/iio/adc/hi8435.c | 2 +-
drivers/iio/adc/max1363.c | 2 +-
drivers/iio/adc/pac1921.c | 3 +-
drivers/iio/adc/palmas_gpadc.c | 2 +-
drivers/iio/adc/ti-ads1015.c | 2 +-
drivers/iio/adc/xilinx-ams.c | 2 +-
drivers/iio/adc/xilinx-xadc-events.c | 2 +-
drivers/iio/adc/xilinx-xadc.h | 2 +-
drivers/iio/cdc/ad7150.c | 2 +-
drivers/iio/dac/ad5421.c | 2 +-
drivers/iio/dac/ad8460.c | 2 +-
drivers/iio/dummy/iio_simple_dummy.h | 2 +-
drivers/iio/dummy/iio_simple_dummy_events.c | 2 +-
drivers/iio/gyro/bmg160_core.c | 2 +-
drivers/iio/imu/bmi323/bmi323_core.c | 2 +-
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 9 ++---
drivers/iio/imu/kmx61.c | 2 +-
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 2 +-
drivers/iio/light/adux1020.c | 3 +-
drivers/iio/light/apds9300.c | 2 +-
drivers/iio/light/apds9306.c | 2 +-
drivers/iio/light/apds9960.c | 4 +--
drivers/iio/light/bh1745.c | 50 ++++++++++++--------------
drivers/iio/light/cm36651.c | 2 +-
drivers/iio/light/gp2ap002.c | 2 +-
drivers/iio/light/gp2ap020a00f.c | 2 +-
drivers/iio/light/iqs621-als.c | 2 +-
drivers/iio/light/ltr390.c | 5 +--
drivers/iio/light/ltr501.c | 6 +---
drivers/iio/light/max44009.c | 2 +-
drivers/iio/light/opt3001.c | 2 +-
drivers/iio/light/stk3310.c | 5 +--
drivers/iio/light/tcs3472.c | 2 +-
drivers/iio/light/tsl2563.c | 2 +-
drivers/iio/light/tsl2591.c | 2 +-
drivers/iio/light/tsl2772.c | 2 +-
drivers/iio/light/us5182d.c | 2 +-
drivers/iio/light/vcnl4000.c | 5 +--
drivers/iio/light/veml6030.c | 5 +--
drivers/iio/position/iqs624-pos.c | 2 +-
drivers/iio/proximity/aw96103.c | 2 +-
drivers/iio/proximity/cros_ec_mkbp_proximity.c | 2 +-
drivers/iio/proximity/hx9023s.c | 2 +-
drivers/iio/proximity/irsd200.c | 3 +-
drivers/iio/proximity/sx9500.c | 2 +-
drivers/iio/proximity/sx_common.c | 2 +-
drivers/iio/proximity/sx_common.h | 2 +-
drivers/iio/proximity/vcnl3020.c | 2 +-
drivers/iio/temperature/mcp9600.c | 2 +-
drivers/iio/temperature/tmp007.c | 2 +-
include/linux/iio/iio.h | 2 +-
65 files changed, 96 insertions(+), 112 deletions(-)
---
base-commit: 9090ececac9ff1e22fb7e042f3c886990a8fb090
change-id: 20241023-iio-fix-write-event-config-signature-1bc1f52fdedf
Best regards,
--
Julien Stephan <jstephan@baylibre.com>
next reply other threads:[~2024-10-24 9:14 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-24 9:11 Julien Stephan [this message]
2024-10-24 9:11 ` [PATCH 1/7] iio: light: bh1745: simplify code in write_event_config callback Julien Stephan
2024-10-26 12:20 ` Jonathan Cameron
2024-10-24 9:11 ` [PATCH 2/7] iio: light: ltr390: " Julien Stephan
2024-10-26 12:22 ` Jonathan Cameron
2024-10-24 9:11 ` [PATCH 3/7] iio: light: ltr501: " Julien Stephan
2024-10-26 12:23 ` Jonathan Cameron
2024-10-24 9:11 ` [PATCH 4/7] iio: light: veml6030: " Julien Stephan
2024-10-26 12:25 ` Jonathan Cameron
2024-10-24 9:11 ` [PATCH 5/7] iio: imu: inv_mpu6050: " Julien Stephan
2024-10-24 12:16 ` Jean-Baptiste Maneyrol
2024-10-26 12:27 ` Jonathan Cameron
2024-10-24 9:11 ` [PATCH 6/7] iio: light: stk3310: " Julien Stephan
2024-10-26 12:30 ` Jonathan Cameron
2024-10-24 9:11 ` [PATCH 7/7] iio: fix write_event_config signature Julien Stephan
2024-10-26 12:59 ` Jonathan Cameron
2024-10-30 14:07 ` Julien Stephan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241024-iio-fix-write-event-config-signature-v1-0-7d29e5a31b00@baylibre.com \
--to=jstephan@baylibre.com \
--cc=Mariel.Tinaco@analog.com \
--cc=Michael.Hennerich@analog.com \
--cc=anand.ashok.dumbre@xilinx.com \
--cc=anshulusr@gmail.com \
--cc=antoniu.miclaus@analog.com \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=cosmin.tanislav@analog.com \
--cc=dan@dlrobertson.com \
--cc=groeck@chromium.org \
--cc=jagathjog1996@gmail.com \
--cc=javier.carrasco.cruz@gmail.com \
--cc=jean-baptiste.maneyrol@tdk.com \
--cc=jic23@kernel.org \
--cc=julia.lawall@inria.fr \
--cc=ktsai@capellamicro.com \
--cc=lars@metafoo.de \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=marcelo.schmitt@analog.com \
--cc=matteomartelli3@gmail.com \
--cc=michal.simek@amd.com \
--cc=muditsharma.info@gmail.com \
--cc=ramona.gradinariu@analog.com \
--cc=subhajit.ghosh@tweaklogic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).