Re: [PATCH v8 04/13] coresight-tpda: Add DSB dataset support

From: kernel test robot
Date: Tue Aug 22 2023 - 21:36:26 EST


Hi Tao,

kernel test robot noticed the following build warnings:

[auto build test WARNING on robh/for-next]
[also build test WARNING on linus/master v6.5-rc7 next-20230822]
[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/Tao-Zhang/coresight-tpdm-Remove-the-unnecessary-lock/20230822-132946
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link: https://lore.kernel.org/r/1692681973-20764-5-git-send-email-quic_taozha%40quicinc.com
patch subject: [PATCH v8 04/13] coresight-tpda: Add DSB dataset support
config: arm64-randconfig-r031-20230823 (https://download.01.org/0day-ci/archive/20230823/202308230927.JBX1uKOE-lkp@xxxxxxxxx/config)
compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project.git 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
reproduce: (https://download.01.org/0day-ci/archive/20230823/202308230927.JBX1uKOE-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/202308230927.JBX1uKOE-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/hwtracing/coresight/coresight-tpda.c:168:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (atomic_read(&in->dest_refcnt) == 0) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hwtracing/coresight/coresight-tpda.c:177:9: note: uninitialized use occurs here
return ret;
^~~
drivers/hwtracing/coresight/coresight-tpda.c:168:2: note: remove the 'if' if its condition is always true
if (atomic_read(&in->dest_refcnt) == 0) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hwtracing/coresight/coresight-tpda.c:165:9: note: initialize the variable 'ret' to silence this warning
int ret;
^
= 0
1 warning generated.


vim +168 drivers/hwtracing/coresight/coresight-tpda.c

159
160 static int tpda_enable(struct coresight_device *csdev,
161 struct coresight_connection *in,
162 struct coresight_connection *out)
163 {
164 struct tpda_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent);
165 int ret;
166
167 spin_lock(&drvdata->spinlock);
> 168 if (atomic_read(&in->dest_refcnt) == 0) {
169 ret = __tpda_enable(drvdata, in->dest_port);
170 if (!ret) {
171 atomic_inc(&in->dest_refcnt);
172 dev_dbg(drvdata->dev, "TPDA inport %d enabled.\n", in->dest_port);
173 }
174 }
175
176 spin_unlock(&drvdata->spinlock);
177 return ret;
178 }
179

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