Re: [PATCH V1 2/3] drivers: misc: dcc: Add driver support for Data Capture and Compare unit(DCC)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Souradeep,

kernel test robot noticed the following build warnings:

[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on char-misc/char-misc-next char-misc/char-misc-linus linus/master v6.3-rc7 next-20230417]
[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/Souradeep-Chowdhury/dt-bindings-misc-qcom-dcc-Add-the-dtschema/20230414-220304
patch link:    https://lore.kernel.org/r/b1a9cbbcfefe133cc9047a71a2acdaa74239df29.1681480351.git.quic_schowdhu%40quicinc.com
patch subject: [PATCH V1 2/3] drivers: misc: dcc: Add driver support for Data Capture and Compare unit(DCC)
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20230418/202304181327.0grVYsHS-lkp@xxxxxxxxx/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 9638da200e00bd069e6dd63604e14cbafede9324)
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/intel-lab-lkp/linux/commit/f3f73f6008e1ebca6fba848e260b1f938d91be95
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Souradeep-Chowdhury/dt-bindings-misc-qcom-dcc-Add-the-dtschema/20230414-220304
        git checkout f3f73f6008e1ebca6fba848e260b1f938d91be95
        # 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=arm64 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/misc/

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

All warnings (new ones prefixed by >>):

>> drivers/misc/dcc.c:217:14: warning: variable 'ret' is used uninitialized whenever 'for' loop exits because its condition is false [-Wsometimes-uninitialized]
           for (i = 0; i < drvdata->nr_link_list; i++) {
                       ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/dcc.c:238:9: note: uninitialized use occurs here
           return ret;
                  ^~~
   drivers/misc/dcc.c:217:14: note: remove the condition if it is always true
           for (i = 0; i < drvdata->nr_link_list; i++) {
                       ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/dcc.c:190:9: note: initialize the variable 'ret' to silence this warning
           int ret;
                  ^
                   = 0
   1 warning generated.


vim +217 drivers/misc/dcc.c

   186	
   187	static int dcc_sw_trigger(struct dcc_drvdata *drvdata)
   188	{
   189		void __iomem *addr;
   190		int ret;
   191		int i;
   192		u32 status;
   193		u32 ll_cfg;
   194		u32 tmp_ll_cfg;
   195		u32 val;
   196	
   197		mutex_lock(&drvdata->mutex);
   198	
   199		for (i = 0; i < drvdata->nr_link_list; i++) {
   200			if (!test_bit(i, drvdata->enable_bitmap))
   201				continue;
   202			ll_cfg = dcc_list_readl(drvdata, i, DCC_LL_CFG);
   203			tmp_ll_cfg = ll_cfg & ~DCC_TRIGGER_MASK;
   204			dcc_list_writel(drvdata, tmp_ll_cfg, i, DCC_LL_CFG);
   205			dcc_list_writel(drvdata, 1, i, DCC_LL_SW_TRIGGER);
   206			dcc_list_writel(drvdata, ll_cfg, i, DCC_LL_CFG);
   207		}
   208	
   209		addr = drvdata->base + DCC_STATUS(drvdata->mem_map_ver);
   210		if (readl_poll_timeout(addr, val, !FIELD_GET(DCC_STATUS_MASK, val),
   211				       1, STATUS_READY_TIMEOUT)) {
   212			dev_err(drvdata->dev, "DCC is busy after receiving sw trigger\n");
   213			ret = -EBUSY;
   214			goto out_unlock;
   215		}
   216	
 > 217		for (i = 0; i < drvdata->nr_link_list; i++) {
   218			if (!test_bit(i, drvdata->enable_bitmap))
   219				continue;
   220	
   221			status = dcc_list_readl(drvdata, i, DCC_LL_BUS_ACCESS_STATUS);
   222			if (!status)
   223				continue;
   224	
   225			dev_err(drvdata->dev, "Read access error for list %d err: 0x%x\n",
   226				i, status);
   227			ll_cfg = dcc_list_readl(drvdata, i, DCC_LL_CFG);
   228			tmp_ll_cfg = ll_cfg & ~DCC_TRIGGER_MASK;
   229			dcc_list_writel(drvdata, tmp_ll_cfg, i, DCC_LL_CFG);
   230			dcc_list_writel(drvdata, DCC_STATUS_MASK, i, DCC_LL_BUS_ACCESS_STATUS);
   231			dcc_list_writel(drvdata, ll_cfg, i, DCC_LL_CFG);
   232			ret = -ENODATA;
   233			break;
   234		}
   235	
   236	out_unlock:
   237		mutex_unlock(&drvdata->mutex);
   238		return ret;
   239	}
   240	

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



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux