Re: [PATCH v1 2/2] hwmon: Driver for Nuvoton NCT736X

From: kernel test robot
Date: Tue Dec 05 2023 - 09:15:30 EST


Hi,

kernel test robot noticed the following build warnings:

[auto build test WARNING on linus/master]
[also build test WARNING on v6.7-rc4 next-20231205]
[cannot apply to groeck-staging/hwmon-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/baneric926-gmail-com/dt-bindings-hwmon-Add-nct736x-bindings/20231204-135942
base: linus/master
patch link: https://lore.kernel.org/r/20231204055650.788388-3-kcfeng0%40nuvoton.com
patch subject: [PATCH v1 2/2] hwmon: Driver for Nuvoton NCT736X
config: um-randconfig-001-20231205 (https://download.01.org/0day-ci/archive/20231205/202312052243.AbRqbNyT-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231205/202312052243.AbRqbNyT-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/202312052243.AbRqbNyT-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

drivers/hwmon/nct736x.c: In function 'nct736x_init_chip.constprop':
>> drivers/hwmon/nct736x.c:367:15: warning: 'gpio0_3' is used uninitialized [-Wuninitialized]
367 | ret = nct736x_write_reg(client, NCT736X_REG_GPIO_0_3, gpio0_3);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/gpio0_3 +367 drivers/hwmon/nct736x.c

334
335 static int nct736x_init_chip(struct i2c_client *client,
336 u32 pwm_mask, u32 fanin_mask, u32 wdt_cfg)
337 {
338 const struct i2c_device_id *id = i2c_match_id(nct736x_id, client);
339 u8 i, gpio0_3, gpio4_7, gpio10_13, gpio14_17;
340 int ret;
341
342 for (i = 0; i < NCT736X_PWM_COUNT; i++) {
343 if (i < 4) {
344 if (pwm_mask & BIT_CHECK(i))
345 gpio0_3 |= PWM_SEL(i);
346 if (fanin_mask & BIT_CHECK(i))
347 gpio10_13 |= FANIN_SEL(i);
348 } else if (i < 8) {
349 if (pwm_mask & BIT_CHECK(i))
350 gpio4_7 |= PWM_SEL(i);
351 if (fanin_mask & BIT_CHECK(i))
352 gpio14_17 |= FANIN_SEL(i);
353 } else if (i < 12) {
354 if (pwm_mask & BIT_CHECK(i))
355 gpio10_13 |= PWM_SEL(i);
356 if (fanin_mask & BIT_CHECK(i))
357 gpio0_3 |= FANIN_SEL(i);
358 } else {
359 if (pwm_mask & BIT_CHECK(i))
360 gpio14_17 |= PWM_SEL(i);
361 if (fanin_mask & BIT_CHECK(i))
362 gpio4_7 |= FANIN_SEL(i);
363 }
364 }
365
366 /* Pin Function Configuration */
> 367 ret = nct736x_write_reg(client, NCT736X_REG_GPIO_0_3, gpio0_3);
368 if (ret < 0)
369 return ret;
370 ret = nct736x_write_reg(client, NCT736X_REG_GPIO_4_7, gpio4_7);
371 if (ret < 0)
372 return ret;
373 ret = nct736x_write_reg(client, NCT736X_REG_GPIO_10_13, gpio10_13);
374 if (ret < 0)
375 return ret;
376 ret = nct736x_write_reg(client, NCT736X_REG_GPIO_14_17, gpio14_17);
377 if (ret < 0)
378 return ret;
379
380 /* PWM and FANIN Monitoring Enable */
381 ret = nct736x_write_reg(client, NCT736X_REG_PWMEN_0_7,
382 pwm_mask & 0xff);
383 if (ret < 0)
384 return ret;
385 ret = nct736x_write_reg(client,
386 NCT736X_REG_PWMEN_8_15, (pwm_mask >> 8) & 0xff);
387 if (ret < 0)
388 return ret;
389 ret = nct736x_write_reg(client, NCT736X_REG_FANINEN_0_7,
390 fanin_mask & 0xff);
391 if (ret < 0)
392 return ret;
393 ret = nct736x_write_reg(client, NCT736X_REG_FANINEN_8_15,
394 (fanin_mask >> 8) & 0xff);
395 if (ret < 0)
396 return ret;
397
398 /* Watchdog Timer Configuration */
399 if (wdt_cfg != 0xff && id->driver_data == nct7363) {
400 ret = nct736x_write_reg(client, NCT7363_REG_WDT, wdt_cfg);
401 if (ret < 0)
402 return ret;
403 }
404
405 return 0;
406 }
407

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki