Skip to contentSkip to conversation

iio: cros_ec_activity: Fix function casting error

PATCH In review Gwendal Grignou 2 participants 3 messages Jun 23, 2025 – Jun 24, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: cros_ec_activity: Fix function casting error

.write_event_configwrite_event_config expects |state| to be an int not a bool:

```
drivers/iio/common/cros_ec_sensors/cros_ec_activity.c:203:24: error:
incompatible function pointer types initializing
'int (*)(struct iio_dev *, const struct iio_chan_spec *, enum iio_event_type, enum iio_event_direction, int)'
with an expression of type
'int (struct iio_dev *, const struct iio_chan_spec *, enum iio_event_type, enum iio_event_direction, bool)'
...
[-Wincompatible-function-pointer-types]
```
Fixes 9ad446870236 ("iio: cros_ec_sensors: add cros_ec_activity driver")
---
 drivers/iio/common/cros_ec_sensors/cros_ec_activity.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/common/cros_ec_sensors/cros_ec_activity.c +1 -1
index 6e38d115b6fe8..1d97a68e6ce11 100644
@@ -122,7 +122,7 @@ static int cros_ec_activity_write_event_config(struct iio_dev *indio_dev,
 					       const struct iio_chan_spec *chan,
 					       enum iio_event_type type,
 					       enum iio_event_direction dir,
-					       bool state)
+					       int state)
 {
 	struct cros_ec_sensors_state *st = iio_priv(indio_dev);
 
Signature · 1 line
2.50.0.rc2.761.g2dc52ea45b-goog
#1 lore raw
Quoted 2 lines · Gwendal Grignou

.write_event_configwrite_event_config expects |state| to be an int not a bool:

No, state is a bool since commit b4b42f28a0df
("iio: fix write_event_config signature").

#2 lore raw
Quoted 7 lines · Tzung-Bi Shih
Quoted 2 lines · Gwendal Grignou

.write_event_configwrite_event_config expects |state| to be an int not a bool:

No, state is a bool since commit b4b42f28a0df
("iio: fix write_event_config signature").

Correct, I just realized my mistake. Please ignore this patch as well...

Gwendal.

Quoted 1 line