From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A47E863B6; Mon, 27 Mar 2023 17:00:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679936422; x=1711472422; h=date:from:to:cc:subject:message-id:mime-version; bh=KpSiSJTADRt2+AXtkSI1jnd1/gM6eG11nprHObpr5r4=; b=IP3NHbApJIzTFg+HkhQyQ4lMdXnjDQ1Cnrxd36974xuPlHNubMEoi6ju TReGZ3fNcd+nPLpM1xVU24dpun0tPfs7Qo11eAtfTX4qYnklon85kkObp w3R/MdRyIhesrPyodJjzgMrGbtX254S+BBfwRy2/0FvydGWrkM4xZGXwq EmKEEhQoo2i3HzZE2zVGMOxKoerD1kj0VMBi3+8sDyQDsFPLnnsKa1gm/ taVdR8FlX9X5AWiVgXUqLzTtKea6hfARp1k3XuwoZXSHu//L5at4jW2Hd 8k8cpOl172CRgJRCYoYMJbaUBN1cEB8MIqaSfjyhVXCtoUGoYd3ZnRtyN Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10662"; a="328768096" X-IronPort-AV: E=Sophos;i="5.98,295,1673942400"; d="scan'208";a="328768096" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2023 10:00:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10662"; a="677048654" X-IronPort-AV: E=Sophos;i="5.98,295,1673942400"; d="scan'208";a="677048654" Received: from lkp-server01.sh.intel.com (HELO b613635ddfff) ([10.239.97.150]) by orsmga007.jf.intel.com with ESMTP; 27 Mar 2023 10:00:19 -0700 Received: from kbuild by b613635ddfff with local (Exim 4.96) (envelope-from ) id 1pgqCg-000HrP-31; Mon, 27 Mar 2023 17:00:18 +0000 Date: Tue, 28 Mar 2023 01:00:05 +0800 From: kernel test robot To: Greg Kroah-Hartman 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 Message-ID: <202303280045.4oaaezcn-lkp@intel.com> Precedence: bulk X-Mailing-List: oe-kbuild-all@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 | 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