tree:
https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-4.19
head: ce53feb85da0d335885fe5d5aa0a0deaca233b54
commit: a71c841967bacf0891f9a83baea0dc4e637d43a8 [48/55] CHROMIUM: platform/iio:
cros_ec_sensor_ring: connect to cros_ec_sensorhub
config:
arm64-chromiumos-qualcomm-customedconfig-chrome-os:chromeos-4.19:ce53feb85da0d335885fe5d5aa0a0deaca233b54
(attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout a71c841967bacf0891f9a83baea0dc4e637d43a8
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/platform/chrome/cros_ec_sensorhub_ring.c: In function
'cros_sensorhub_send_sample':
> drivers/platform/chrome/cros_ec_sensorhub_ring.c:45:3: error:
cast between incompatible function types from 'cros_ec_sensorhub_push_data_cb_t'
{aka 'int (*)(struct iio_dev *, short int *, long long int)'} to 'int
(*)(struct iio_dev *, struct cros_ec_sensors_ring_sample *)'
[-Werror=cast-function-type]
45 | (cros_ec_sensorhub_push_samples_cb_t)
| ^
drivers/platform/chrome/cros_ec_sensorhub_ring.c: In function
'cros_ec_sensorhub_register_push_sample':
> drivers/platform/chrome/cros_ec_sensorhub_ring.c:130:4: error:
cast between incompatible function types from
'cros_ec_sensorhub_push_samples_cb_t' {aka 'int (*)(struct iio_dev *, struct
cros_ec_sensors_ring_sample *)'} to 'int (*)(struct iio_dev *, s16 *, s64)'
{aka 'int (*)(struct iio_dev *, short int *, long long int)'}
[-Werror=cast-function-type]
130 | (cros_ec_sensorhub_push_data_cb_t)cb);
| ^
cc1: all warnings being treated as errors
vim +45 drivers/platform/chrome/cros_ec_sensorhub_ring.c
34
35 #if IS_ENABLED(CONFIG_IIO_CROS_EC_SENSORS_RING)
36 /*
37 * To be compliant with existing code, device buffer is only for
38 * triggered samples.
39 */
40 static inline int
41 cros_sensorhub_send_sample(struct cros_ec_sensorhub *sensorhub,
42 struct cros_ec_sensors_ring_sample *sample)
43 {
44 cros_ec_sensorhub_push_samples_cb_t cb =
45 (cros_ec_sensorhub_push_samples_cb_t)
46 sensorhub->push_data[sensorhub->sensor_num].push_data_cb;
47 int id = sample->sensor_id;
48 struct iio_dev *indio_dev;
49
50 if (id > sensorhub->sensor_num)
51 return -EINVAL;
52
53 indio_dev = sensorhub->push_data[sensorhub->sensor_num].indio_dev;
54 if (!indio_dev)
55 return 0;
56
57 return cb(indio_dev, sample);
58 }
59 #else
60 static inline int
61 cros_sensorhub_send_sample(struct cros_ec_sensorhub *sensorhub,
62 struct cros_ec_sensors_ring_sample *sample)
63 {
64 int id = sample->sensor_id;
65 cros_ec_sensorhub_push_data_cb_t cb;
66 struct iio_dev *indio_dev;
67
68 cb = sensorhub->push_data[id].push_data_cb;
69 if (!cb)
70 return 0;
71
72 indio_dev = sensorhub->push_data[id].indio_dev;
73
74 if (sample->flag & MOTIONSENSE_SENSOR_FLAG_FLUSH)
75 return 0;
76
77 return cb(indio_dev, sample->vector, sample->timestamp);
78 }
79 #endif
80
81 /**
82 * cros_ec_sensorhub_register_push_data() - register the callback to the hub.
83 *
84 * @sensorhub : Sensor Hub object
85 * @sensor_num : The sensor the caller is interested in.
86 * @indio_dev : The iio device to use when a sample arrives.
87 * @cb : The callback to call when a sample arrives.
88 *
89 * The callback cb will be used by cros_ec_sensorhub_ring to distribute events
90 * from the EC.
91 *
92 * Return: 0 when callback is registered.
93 * EINVAL is the sensor number is invalid or the slot already used.
94 */
95 int cros_ec_sensorhub_register_push_data(struct cros_ec_sensorhub *sensorhub,
96 u8 sensor_num,
97 struct iio_dev *indio_dev,
98 cros_ec_sensorhub_push_data_cb_t cb)
99 {
100 if (sensor_num >= sensorhub->sensor_num + 1)
101 return -EINVAL;
102 if (sensorhub->push_data[sensor_num].indio_dev)
103 return -EINVAL;
104
105 sensorhub->push_data[sensor_num].indio_dev = indio_dev;
106 sensorhub->push_data[sensor_num].push_data_cb = cb;
107
108 return 0;
109 }
110 EXPORT_SYMBOL_GPL(cros_ec_sensorhub_register_push_data);
111
112 void cros_ec_sensorhub_unregister_push_data(struct cros_ec_sensorhub *sensorhub,
113 u8 sensor_num)
114 {
115 sensorhub->push_data[sensor_num].indio_dev = NULL;
116 sensorhub->push_data[sensor_num].push_data_cb = NULL;
117 }
118 EXPORT_SYMBOL_GPL(cros_ec_sensorhub_unregister_push_data);
119
120 #if IS_ENABLED(CONFIG_IIO_CROS_EC_SENSORS_RING)
121 int cros_ec_sensorhub_register_push_sample(
122 struct cros_ec_sensorhub *sensorhub,
123 struct iio_dev *indio_dev,
124 cros_ec_sensorhub_push_samples_cb_t cb)
125 {
126 return cros_ec_sensorhub_register_push_data(
127 sensorhub,
128 sensorhub->sensor_num,
129 indio_dev,
130 (cros_ec_sensorhub_push_data_cb_t)cb);
131 }
132 EXPORT_SYMBOL_GPL(cros_ec_sensorhub_register_push_sample);
133
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org