oe-kbuild-all.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	devel@driverdev.osuosl.org
Subject: [driver-core:class_cleanup 34/80] arch/powerpc/sysdev/fsl_mpic_timer_wakeup.c:129:6: error: variable 'ret' is used uninitialized whenever 'if' condition is false
Date: Tue, 28 Mar 2023 01:00:05 +0800	[thread overview]
Message-ID: <202303280045.4oaaezcn-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git class_cleanup
head:   c6dd61fdeee23ae8743e3ac8234ab05f94bcc601
commit: c93bd175414ac43d7ea6cb2a17f49eb91af03f00 [34/80] powerpc/fsl: move to use bus_get_dev_root()
config: powerpc-randconfig-r003-20230326 (https://download.01.org/0day-ci/archive/20230328/202303280045.4oaaezcn-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 67409911353323ca5edf2049ef0df54132fa1ca7)
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 powerpc cross compiling tool for clang build
        # apt-get install binutils-powerpc-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?id=c93bd175414ac43d7ea6cb2a17f49eb91af03f00
        git remote add driver-core https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
        git fetch --no-tags driver-core class_cleanup
        git checkout c93bd175414ac43d7ea6cb2a17f49eb91af03f00
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=powerpc olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=powerpc SHELL=/bin/bash arch/powerpc/sysdev/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303280045.4oaaezcn-lkp@intel.com/

All errors (new ones prefixed by >>):

>> arch/powerpc/sysdev/fsl_mpic_timer_wakeup.c:129:6: error: variable 'ret' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
           if (dev_root) {
               ^~~~~~~~
   arch/powerpc/sysdev/fsl_mpic_timer_wakeup.c:136:9: note: uninitialized use occurs here
           return ret;
                  ^~~
   arch/powerpc/sysdev/fsl_mpic_timer_wakeup.c:129:2: note: remove the 'if' if its condition is always true
           if (dev_root) {
           ^~~~~~~~~~~~~~
   arch/powerpc/sysdev/fsl_mpic_timer_wakeup.c:120:9: note: initialize the variable 'ret' to silence this warning
           int ret;
                  ^
                   = 0
   1 error generated.


vim +129 arch/powerpc/sysdev/fsl_mpic_timer_wakeup.c

   113	
   114	static struct device_attribute mpic_attributes = __ATTR(timer_wakeup, 0644,
   115				fsl_timer_wakeup_show, fsl_timer_wakeup_store);
   116	
   117	static int __init fsl_wakeup_sys_init(void)
   118	{
   119		struct device *dev_root;
   120		int ret;
   121	
   122		fsl_wakeup = kzalloc(sizeof(struct fsl_mpic_timer_wakeup), GFP_KERNEL);
   123		if (!fsl_wakeup)
   124			return -ENOMEM;
   125	
   126		INIT_WORK(&fsl_wakeup->free_work, fsl_free_resource);
   127	
   128		dev_root = bus_get_dev_root(&mpic_subsys);
 > 129		if (dev_root) {
   130			ret = device_create_file(dev_root, &mpic_attributes);
   131			put_device(dev_root);
   132			if (ret)
   133				kfree(fsl_wakeup);
   134		}
   135	
   136		return ret;
   137	}
   138	

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

                 reply	other threads:[~2023-03-27 17:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202303280045.4oaaezcn-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).