From: kernel test robot <lkp@intel.com>
To: Khaled ROMDHANI <khaledromdhani216@gmail.com>,
clm@fb.com, josef@toxicpanda.com, dsterba@suse.com
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
Khaled ROMDHANI <khaledromdhani216@gmail.com>,
linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH v3] fs/btrfs: Fix uninitialized variable
Date: Wed, 21 Apr 2021 05:04:25 +0800 [thread overview]
Message-ID: <202104210455.qlC4UGyd-lkp@intel.com> (raw)
In-Reply-To: <20210420151626.6045-1-khaledromdhani216@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2852 bytes --]
Hi Khaled,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on kdave/for-next]
[also build test WARNING on v5.12-rc8 next-20210420]
[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]
url: https://github.com/0day-ci/linux/commits/Khaled-ROMDHANI/fs-btrfs-Fix-uninitialized-variable/20210420-231754
base: https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
config: arm-randconfig-r021-20210420 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project ca8eef7e3da8f750d7c7aa004fe426d1d34787ea)
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/0day-ci/linux/commit/c05b2a58c9ed11bd753f1e64695bd89da715fbaa
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Khaled-ROMDHANI/fs-btrfs-Fix-uninitialized-variable/20210420-231754
git checkout c05b2a58c9ed11bd753f1e64695bd89da715fbaa
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> fs/btrfs/zoned.c:146:2: warning: variable 'zone' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
default:
^~~~~~~
fs/btrfs/zoned.c:153:14: note: uninitialized use occurs here
return (u32)zone;
^~~~
fs/btrfs/zoned.c:139:10: note: initialize the variable 'zone' to silence this warning
u64 zone;
^
= 0
1 warning generated.
vim +/zone +146 fs/btrfs/zoned.c
133
134 /*
135 * Get the first zone number of the superblock mirror
136 */
137 static inline u32 sb_zone_number(int shift, int mirror)
138 {
139 u64 zone;
140
141 ASSERT(mirror < BTRFS_SUPER_MIRROR_MAX);
142 switch (mirror) {
143 case 0: zone = 0; break;
144 case 1: zone = 1ULL << (BTRFS_SB_LOG_FIRST_SHIFT - shift); break;
145 case 2: zone = 1ULL << (BTRFS_SB_LOG_SECOND_SHIFT - shift); break;
> 146 default:
147 ASSERT(zone);
148 break;
149 }
150
151 ASSERT(zone <= U32_MAX);
152
153 return (u32)zone;
154 }
155
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34341 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v3] fs/btrfs: Fix uninitialized variable
Date: Wed, 21 Apr 2021 05:04:25 +0800 [thread overview]
Message-ID: <202104210455.qlC4UGyd-lkp@intel.com> (raw)
In-Reply-To: <20210420151626.6045-1-khaledromdhani216@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2925 bytes --]
Hi Khaled,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on kdave/for-next]
[also build test WARNING on v5.12-rc8 next-20210420]
[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]
url: https://github.com/0day-ci/linux/commits/Khaled-ROMDHANI/fs-btrfs-Fix-uninitialized-variable/20210420-231754
base: https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
config: arm-randconfig-r021-20210420 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project ca8eef7e3da8f750d7c7aa004fe426d1d34787ea)
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/0day-ci/linux/commit/c05b2a58c9ed11bd753f1e64695bd89da715fbaa
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Khaled-ROMDHANI/fs-btrfs-Fix-uninitialized-variable/20210420-231754
git checkout c05b2a58c9ed11bd753f1e64695bd89da715fbaa
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> fs/btrfs/zoned.c:146:2: warning: variable 'zone' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
default:
^~~~~~~
fs/btrfs/zoned.c:153:14: note: uninitialized use occurs here
return (u32)zone;
^~~~
fs/btrfs/zoned.c:139:10: note: initialize the variable 'zone' to silence this warning
u64 zone;
^
= 0
1 warning generated.
vim +/zone +146 fs/btrfs/zoned.c
133
134 /*
135 * Get the first zone number of the superblock mirror
136 */
137 static inline u32 sb_zone_number(int shift, int mirror)
138 {
139 u64 zone;
140
141 ASSERT(mirror < BTRFS_SUPER_MIRROR_MAX);
142 switch (mirror) {
143 case 0: zone = 0; break;
144 case 1: zone = 1ULL << (BTRFS_SB_LOG_FIRST_SHIFT - shift); break;
145 case 2: zone = 1ULL << (BTRFS_SB_LOG_SECOND_SHIFT - shift); break;
> 146 default:
147 ASSERT(zone);
148 break;
149 }
150
151 ASSERT(zone <= U32_MAX);
152
153 return (u32)zone;
154 }
155
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34341 bytes --]
next prev parent reply other threads:[~2021-04-20 21:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-20 15:16 [PATCH v3] fs/btrfs: Fix uninitialized variable Khaled ROMDHANI
2021-04-20 21:04 ` kernel test robot [this message]
2021-04-20 21:04 ` kernel test robot
2021-04-21 0:07 ` kernel test robot
2021-04-21 0:07 ` kernel test robot
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=202104210455.qlC4UGyd-lkp@intel.com \
--to=lkp@intel.com \
--cc=clang-built-linux@googlegroups.com \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=josef@toxicpanda.com \
--cc=kbuild-all@lists.01.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=khaledromdhani216@gmail.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.