Re: [PATCH] watchdog: add in watchdog for nct6686

From: kernel test robot
Date: Fri Sep 08 2023 - 10:55:27 EST


Hi David,

kernel test robot noticed the following build warnings:

[auto build test WARNING on linus/master]
[also build test WARNING on v6.5 next-20230908]
[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/David-Ober/watchdog-add-in-watchdog-for-nct6686/20230907-235048
base: linus/master
patch link: https://lore.kernel.org/r/20230907113517.31147-1-dober6023%40gmail.com
patch subject: [PATCH] watchdog: add in watchdog for nct6686
config: powerpc64-allyesconfig (https://download.01.org/0day-ci/archive/20230908/202309082202.ZRLExbNG-lkp@xxxxxxxxx/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230908/202309082202.ZRLExbNG-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/202309082202.ZRLExbNG-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/watchdog/nct6686_wdt.c:352:3: warning: variable 'wdt' is uninitialized when used here [-Wuninitialized]
352 | wdt->timeout, nowayout);
| ^~~
include/linux/dev_printk.h:155:39: note: expanded from macro 'dev_dbg'
155 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~
include/linux/dynamic_debug.h:274:19: note: expanded from macro 'dynamic_dev_dbg'
274 | dev, fmt, ##__VA_ARGS__)
| ^~~~~~~~~~~
include/linux/dynamic_debug.h:250:59: note: expanded from macro '_dynamic_func_call'
250 | _dynamic_func_call_cls(_DPRINTK_CLASS_DFLT, fmt, func, ##__VA_ARGS__)
| ^~~~~~~~~~~
include/linux/dynamic_debug.h:248:65: note: expanded from macro '_dynamic_func_call_cls'
248 | __dynamic_func_call_cls(__UNIQUE_ID(ddebug), cls, fmt, func, ##__VA_ARGS__)
| ^~~~~~~~~~~
include/linux/dynamic_debug.h:224:15: note: expanded from macro '__dynamic_func_call_cls'
224 | func(&id, ##__VA_ARGS__); \
| ^~~~~~~~~~~
drivers/watchdog/nct6686_wdt.c:309:29: note: initialize the variable 'wdt' to silence this warning
309 | struct watchdog_device *wdt;
| ^
| = NULL
1 warning generated.


vim +/wdt +352 drivers/watchdog/nct6686_wdt.c

305
306 static int nct6686_probe(struct platform_device *pdev)
307 {
308 struct device *dev = &pdev->dev;
309 struct watchdog_device *wdt;
310 struct resource *res;
311 struct nct6686_data *data;
312 struct nct6686_sio_data *sio_data = dev->platform_data;
313 int ret;
314 u_char reg;
315
316 dev_dbg(&pdev->dev, "Probe NCT6686 called\n");
317 res = platform_get_resource(pdev, IORESOURCE_IO, 0);
318 if (!devm_request_region(dev, res->start, IOREGION_LENGTH, DRVNAME))
319 return -EBUSY;
320
321 data = devm_kzalloc(dev, sizeof(struct nct6686_data), GFP_KERNEL);
322 if (!data)
323 return -ENOMEM;
324
325 data->sio_data.sioreg = sio_data->sioreg;
326 data->addr = res->start;
327 mutex_init(&data->update_lock);
328 platform_set_drvdata(pdev, data);
329
330 /* Watchdog initialization */
331 data->wdt.ops = &nct6686_wdt_ops;
332 data->wdt.info = &nct6686_wdt_info;
333
334 data->wdt.timeout = WATCHDOG_TIMEOUT; /* Set default timeout */
335 data->wdt.min_timeout = MIN_TIMEOUT;
336 data->wdt.max_timeout = MAX_TIMEOUT;
337 data->wdt.parent = &pdev->dev;
338
339 watchdog_init_timeout(&data->wdt, timeout, &pdev->dev);
340 watchdog_set_nowayout(&data->wdt, nowayout);
341 watchdog_set_drvdata(&data->wdt, data);
342
343 /* reset trigger status */
344 reg = nct6686_read(data, WDT_STS);
345 nct6686_write(data, WDT_STS, reg & ~WDT_STS_EVT_MSK);
346
347 watchdog_stop_on_unregister(&data->wdt);
348
349 ret = devm_watchdog_register_device(dev, &data->wdt);
350
351 dev_dbg(&pdev->dev, "initialized. timeout=%d sec (nowayout=%d)\n",
> 352 wdt->timeout, nowayout);
353
354 return ret;
355 }
356

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