From: kernel test robot <lkp@intel.com>
To: Anup Patel <apatel@ventanamicro.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
linux-kernel@vger.kernel.org,
Mayuresh Chitale <mchitale@ventanamicro.com>
Subject: [avpatel:riscv_sbi_dbcn_v1 9/42] arch/riscv/mm/cacheflush.c:123:6: warning: variable 'cbom_hartid' is uninitialized when used here
Date: Tue, 30 Aug 2022 18:44:17 +0800 [thread overview]
Message-ID: <202208301804.6NyqVVPU-lkp@intel.com> (raw)
tree: https://github.com/avpatel/linux.git riscv_sbi_dbcn_v1
head: 74814d446b33fc095867181d8953a92ede0b042c
commit: 9a1ab381c3ec9717a3b694fc72fed88b4dde6b91 [9/42] RISC-V: Move riscv_init_cbom_blocksize() to cacheflush.c
config: riscv-randconfig-r042-20220830 (https://download.01.org/0day-ci/archive/20220830/202208301804.6NyqVVPU-lkp@intel.com/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project c7df82e4693c19e3fd2e25c83eb04d9deb7b7b59)
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 riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/avpatel/linux/commit/9a1ab381c3ec9717a3b694fc72fed88b4dde6b91
git remote add avpatel https://github.com/avpatel/linux.git
git fetch --no-tags avpatel riscv_sbi_dbcn_v1
git checkout 9a1ab381c3ec9717a3b694fc72fed88b4dde6b91
# 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=riscv SHELL=/bin/bash arch/riscv/mm/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> arch/riscv/mm/cacheflush.c:123:6: warning: variable 'cbom_hartid' is uninitialized when used here [-Wuninitialized]
cbom_hartid, hartid);
^~~~~~~~~~~
include/linux/printk.h:517:37: note: expanded from macro 'pr_warn'
printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~
include/linux/printk.h:464:60: note: expanded from macro 'printk'
#define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
^~~~~~~~~~~
include/linux/printk.h:436:19: note: expanded from macro 'printk_index_wrap'
_p_func(_fmt, ##__VA_ARGS__); \
^~~~~~~~~~~
arch/riscv/mm/cacheflush.c:103:18: note: initialize the variable 'cbom_hartid' to silence this warning
int cbom_hartid;
^
= 0
1 warning generated.
vim +/cbom_hartid +123 arch/riscv/mm/cacheflush.c
93
94 #ifdef CONFIG_RISCV_ISA_ZICBOM
95 void riscv_init_cbom_blocksize(void)
96 {
97 struct device_node *node;
98 int ret;
99 u32 val;
100
101 for_each_of_cpu_node(node) {
102 unsigned long hartid;
103 int cbom_hartid;
104
105 ret = riscv_of_processor_hartid(node, &hartid);
106 if (ret)
107 continue;
108
109 if (hartid < 0)
110 continue;
111
112 /* set block-size for cbom extension if available */
113 ret = of_property_read_u32(node, "riscv,cbom-block-size", &val);
114 if (ret)
115 continue;
116
117 if (!riscv_cbom_block_size) {
118 riscv_cbom_block_size = val;
119 cbom_hartid = hartid;
120 } else {
121 if (riscv_cbom_block_size != val)
122 pr_warn("cbom-block-size mismatched between harts %d and %lu\n",
> 123 cbom_hartid, hartid);
--
0-DAY CI Kernel Test Service
https://01.org/lkp
reply other threads:[~2022-08-30 10:45 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=202208301804.6NyqVVPU-lkp@intel.com \
--to=lkp@intel.com \
--cc=apatel@ventanamicro.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=mchitale@ventanamicro.com \
/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
all inboxes | Powered by JetHome®