linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>,
	wim@linux-watchdog.org, linux@roeck-us.net, shawnguo@kernel.org
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
	linux-watchdog@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, grzegorz.jaszczyk@linaro.org
Subject: Re: [PATCH 1/2] watchdog: introduce watchdog_dev_suspend/resume
Date: Thu, 17 Jun 2021 07:21:53 +0800	[thread overview]
Message-ID: <202106170726.zhIcbJGv-lkp@intel.com> (raw)
In-Reply-To: <20210615123904.2568052-2-grzegorz.jaszczyk@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 5886 bytes --]

Hi Grzegorz,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on hwmon/hwmon-next]
[also build test WARNING on soc/for-next linus/master v5.13-rc6 next-20210616]
[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]

url:    https://github.com/0day-ci/linux/commits/Grzegorz-Jaszczyk/introduce-watchdog_dev_suspend-resume/20210616-201447
base:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
config: arm64-randconfig-r022-20210615 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 64720f57bea6a6bf033feef4a5751ab9c0c3b401)
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
        # install arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://github.com/0day-ci/linux/commit/71dadcad8da1862c1205b19ddf4279d494e57545
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Grzegorz-Jaszczyk/introduce-watchdog_dev_suspend-resume/20210616-201447
        git checkout 71dadcad8da1862c1205b19ddf4279d494e57545
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/watchdog/watchdog_dev.c:1232:2: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
           if (watchdog_worker_should_ping(wd_data))
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:58:30: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/watchdog/watchdog_dev.c:1236:6: note: uninitialized use occurs here
           if (ret)
               ^~~
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^~~~
   include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                      ^~~~
   drivers/watchdog/watchdog_dev.c:1232:2: note: remove the 'if' if its condition is always true
           if (watchdog_worker_should_ping(wd_data))
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:56:23: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                         ^
   drivers/watchdog/watchdog_dev.c:1225:9: note: initialize the variable 'ret' to silence this warning
           int ret;
                  ^
                   = 0
   drivers/watchdog/watchdog_dev.c:1263:2: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
           if (watchdog_worker_should_ping(wd_data))
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:58:30: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/watchdog/watchdog_dev.c:1267:9: note: uninitialized use occurs here
           return ret;
                  ^~~
   drivers/watchdog/watchdog_dev.c:1263:2: note: remove the 'if' if its condition is always true
           if (watchdog_worker_should_ping(wd_data))
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:56:23: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                         ^
   drivers/watchdog/watchdog_dev.c:1253:9: note: initialize the variable 'ret' to silence this warning
           int ret;
                  ^
                   = 0
   2 warnings generated.


vim +1232 drivers/watchdog/watchdog_dev.c

  1221	
  1222	int watchdog_dev_suspend(struct watchdog_device *wdd)
  1223	{
  1224		struct watchdog_core_data *wd_data = wdd->wd_data;
  1225		int ret;
  1226	
  1227		if (!wdd->wd_data)
  1228			return -ENODEV;
  1229	
  1230		/* ping for the last time before suspend */
  1231		mutex_lock(&wd_data->lock);
> 1232		if (watchdog_worker_should_ping(wd_data))
  1233			ret = __watchdog_ping(wd_data->wdd);
  1234		mutex_unlock(&wd_data->lock);
  1235	
  1236		if (ret)
  1237			return ret;
  1238	
  1239		/*
  1240		 * make sure that watchdog worker will not kick in when the wdog is
  1241		 * suspended
  1242		 */
  1243		hrtimer_cancel(&wd_data->timer);
  1244		kthread_cancel_work_sync(&wd_data->work);
  1245	
  1246		return 0;
  1247	}
  1248	EXPORT_SYMBOL_GPL(watchdog_dev_suspend);
  1249	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 42627 bytes --]

  parent reply	other threads:[~2021-06-16 23:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-15 12:39 [PATCH 0/2] " Grzegorz Jaszczyk
2021-06-15 12:39 ` [PATCH 1/2] watchdog: " Grzegorz Jaszczyk
2021-06-15 14:18   ` Guenter Roeck
2021-06-16 13:59     ` Grzegorz Jaszczyk
2021-06-16 17:57       ` Guenter Roeck
2021-06-16 23:21   ` kernel test robot [this message]
2021-06-15 12:39 ` [PATCH 2/2] watchdog: imx2_wdg: notify wdog subsystem about wdog suspend/resume Grzegorz Jaszczyk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202106170726.zhIcbJGv-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=grzegorz.jaszczyk@linaro.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=shawnguo@kernel.org \
    --cc=wim@linux-watchdog.org \
    --subject='Re: [PATCH 1/2] watchdog: introduce watchdog_dev_suspend/resume' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).