Re: [PATCH] coresight: Add support of setting trace id

From: kernel test robot
Date: Tue Apr 11 2023 - 01:05:12 EST


Hi Mao,

kernel test robot noticed the following build warnings:

[auto build test WARNING on atorgue-stm32/stm32-next]
[also build test WARNING on soc/for-next linus/master v6.3-rc6 next-20230406]
[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/Mao-Jinlong/coresight-Add-support-of-setting-trace-id/20230410-214246
base: https://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git stm32-next
patch link: https://lore.kernel.org/r/20230410133930.30519-1-quic_jinlmao%40quicinc.com
patch subject: [PATCH] coresight: Add support of setting trace id
config: arm-randconfig-r024-20230410 (https://download.01.org/0day-ci/archive/20230411/202304111249.6nPH3yAY-lkp@xxxxxxxxx/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 2c57868e2e877f73c339796c3374ae660bb77f0d)
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 arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/intel-lab-lkp/linux/commit/f92c27be62a6b3cef125e80682d265773e65cd13
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Mao-Jinlong/coresight-Add-support-of-setting-trace-id/20230410-214246
git checkout f92c27be62a6b3cef125e80682d265773e65cd13
# 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=arm olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/hwtracing/coresight/

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/202304111249.6nPH3yAY-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/hwtracing/coresight/coresight-tpda.c:36:7: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (traceid < 0)
^~~~~~~~~~~
drivers/hwtracing/coresight/coresight-tpda.c:43:9: note: uninitialized use occurs here
return ret;
^~~
drivers/hwtracing/coresight/coresight-tpda.c:36:3: note: remove the 'if' if its condition is always true
if (traceid < 0)
^~~~~~~~~~~~~~~~
drivers/hwtracing/coresight/coresight-tpda.c:26:18: note: initialize the variable 'ret' to silence this warning
int traceid, ret;
^
= 0
1 warning generated.


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

23
24 static int tpda_configure_trace_id(struct tpda_drvdata *drvdata)
25 {
26 int traceid, ret;
27 /*
28 * TPDA must has a unique atid. This atid can uniquely
29 * identify the TPDM trace source connected to the TPDA.
30 * The TPDMs which are connected to same TPDA share the
31 * same trace-id. When TPDA does packetization, different
32 * port will have unique channel number for decoding.
33 */
34 if (!drvdata->traceid) {
35 traceid = coresight_trace_id_get_system_id();
> 36 if (traceid < 0)
37 return traceid;
38
39 drvdata->traceid = traceid;
40 } else
41 ret = coresight_trace_id_set_system_id(drvdata->traceid);
42
43 return ret;
44 }
45

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