On Sat, Jan 20, 2024 at 06:55:32AM +0800, kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next > head: 3af6e24a456437d323d1080bd254053f7af05234 > commit: 6380a59c534ecab1462608a1f76490289a45a377 [134/135] Input: adc-joystick - handle inverted axes > config: i386-randconfig-011-20240120 (https://download.01.org/0day-ci/archive/20240120/202401200614.B4PnBzhk-lkp@xxxxxxxxx/config) > compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240120/202401200614.B4PnBzhk-lkp@xxxxxxxxx/reproduce) > > If you fix the issue in a separate patch/commit (i.e. not just a new version of > the same patch/commit), kindly add following tags > | Reported-by: kernel test robot <lkp@xxxxxxxxx> > | Closes: https://lore.kernel.org/oe-kbuild-all/202401200614.B4PnBzhk-lkp@xxxxxxxxx/ > Assume this means we need to explicitly `#include <linux/minmax.h>`, right? Should I submit a new patch or a bugfix for this patch? Thank you. > All errors (new ones prefixed by >>): > > drivers/input/joystick/adc-joystick.c: In function 'adc_joystick_set_axes': > >> drivers/input/joystick/adc-joystick.c:194:10: error: implicit declaration of function 'min_array' [-Werror=implicit-function-declaration] > 194 | min_array(axes[i].range, 2), > | ^~~~~~~~~ > >> drivers/input/joystick/adc-joystick.c:195:10: error: implicit declaration of function 'max_array'; did you mean 'kmalloc_array'? [-Werror=implicit-function-declaration] > 195 | max_array(axes[i].range, 2), > | ^~~~~~~~~ > | kmalloc_array > cc1: some warnings being treated as errors > > > vim +/min_array +194 drivers/input/joystick/adc-joystick.c > > 135 > 136 static int adc_joystick_set_axes(struct device *dev, struct adc_joystick *joy) > 137 { > 138 struct adc_joystick_axis *axes; > 139 struct fwnode_handle *child; > 140 int num_axes, error, i; > 141 > 142 num_axes = device_get_child_node_count(dev); > 143 if (!num_axes) { > 144 dev_err(dev, "Unable to find child nodes\n"); > 145 return -EINVAL; > 146 } > 147 > 148 if (num_axes != joy->num_chans) { > 149 dev_err(dev, "Got %d child nodes for %d channels\n", > 150 num_axes, joy->num_chans); > 151 return -EINVAL; > 152 } > 153 > 154 axes = devm_kmalloc_array(dev, num_axes, sizeof(*axes), GFP_KERNEL); > 155 if (!axes) > 156 return -ENOMEM; > 157 > 158 device_for_each_child_node(dev, child) { > 159 error = fwnode_property_read_u32(child, "reg", &i); > 160 if (error) { > 161 dev_err(dev, "reg invalid or missing\n"); > 162 goto err_fwnode_put; > 163 } > 164 > 165 if (i >= num_axes) { > 166 error = -EINVAL; > 167 dev_err(dev, "No matching axis for reg %d\n", i); > 168 goto err_fwnode_put; > 169 } > 170 > 171 error = fwnode_property_read_u32(child, "linux,code", > 172 &axes[i].code); > 173 if (error) { > 174 dev_err(dev, "linux,code invalid or missing\n"); > 175 goto err_fwnode_put; > 176 } > 177 > 178 error = fwnode_property_read_u32_array(child, "abs-range", > 179 axes[i].range, 2); > 180 if (error) { > 181 dev_err(dev, "abs-range invalid or missing\n"); > 182 goto err_fwnode_put; > 183 } > 184 > 185 if (axes[i].range[0] > axes[i].range[1]) { > 186 dev_dbg(dev, "abs-axis %d inverted\n", i); > 187 axes[i].inverted = true; > 188 } > 189 > 190 fwnode_property_read_u32(child, "abs-fuzz", &axes[i].fuzz); > 191 fwnode_property_read_u32(child, "abs-flat", &axes[i].flat); > 192 > 193 input_set_abs_params(joy->input, axes[i].code, > > 194 min_array(axes[i].range, 2), > > 195 max_array(axes[i].range, 2), > 196 axes[i].fuzz, axes[i].flat); > 197 input_set_capability(joy->input, EV_ABS, axes[i].code); > 198 } > 199 > 200 joy->axes = axes; > 201 > 202 return 0; > 203 > 204 err_fwnode_put: > 205 fwnode_handle_put(child); > 206 return error; > 207 } > 208 > > -- > 0-DAY CI Kernel Test Service > https://github.com/intel/lkp-tests/wiki