From: kernel test robot <lkp@intel.com>
To: Jianpeng Ma <jianpeng.ma@intel.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
Coly Li <colyli@suse.de>, Qiaowei Ren <qiaowei.ren@intel.com>
Subject: [bcache:nvdimm-meta 3/12] drivers/md/bcache/nvm-pages.c:204:18: warning: variable 'base_pgoff' set but not used
Date: Tue, 27 Jul 2021 03:38:34 +0800 [thread overview]
Message-ID: <202107270326.vDxM0zQP-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3561 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache.git nvdimm-meta
head: e9d63ebcb289612237d5a62fa9876114798555eb
commit: 6d4dbab94b60ec3633c4b5a5244e110f36753b6d [3/12] bcache: initialization of the buddy
config: s390-allyesconfig (attached as .config)
compiler: s390-linux-gcc (GCC) 10.3.0
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
# https://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache.git/commit/?id=6d4dbab94b60ec3633c4b5a5244e110f36753b6d
git remote add bcache https://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache.git
git fetch --no-tags bcache nvdimm-meta
git checkout 6d4dbab94b60ec3633c4b5a5244e110f36753b6d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=s390
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 >>):
drivers/md/bcache/nvm-pages.c: In function 'init_nvmpg_set_header':
>> drivers/md/bcache/nvm-pages.c:204:18: warning: variable 'base_pgoff' set but not used [-Wunused-but-set-variable]
204 | unsigned long base_pgoff;
| ^~~~~~~~~~
vim +/base_pgoff +204 drivers/md/bcache/nvm-pages.c
168
169 /* Namespace 0 contains all meta data of the nvmpg allocation set */
170 static int init_nvmpg_set_header(struct bch_nvmpg_ns *ns)
171 {
172 struct bch_nvmpg_set_header *set_header;
173 struct bch_nvmpg_recs *sys_recs;
174 int i, j, used = 0, rc = 0;
175
176 if (ns->ns_id != 0) {
177 pr_err("unexpected ns_id %u for first nvmpg namespace.\n",
178 ns->ns_id);
179 return -EINVAL;
180 }
181
182 set_header = bch_nvmpg_offset_to_ptr(ns->sb->set_header_offset);
183
184 mutex_lock(&global_nvmpg_set->lock);
185 global_nvmpg_set->set_header = set_header;
186 global_nvmpg_set->heads_size = set_header->size;
187 global_nvmpg_set->heads_used = set_header->used;
188
189 /* Reserve the used space from buddy allocator */
190 reserve_nvmpg_pages(ns, 0, div_u64(ns->pages_offset, ns->page_size));
191
192 sys_recs = ns->base_addr + BCH_NVMPG_SYSRECS_HEAD_OFFSET;
193 for (i = 0; i < set_header->size; i++) {
194 struct bch_nvmpg_head *head;
195
196 head = &set_header->heads[i];
197 if (head->state == BCH_NVMPG_HD_STAT_FREE)
198 continue;
199
200 used++;
201
202 for (j = 0; j < BCH_NVMPG_NS_MAX; j++) {
203 struct bch_nvmpg_recs *recs;
> 204 unsigned long base_pgoff;
205
206 base_pgoff = (unsigned long)ns->base_addr >> PAGE_SHIFT;
207 recs = bch_nvmpg_offset_to_ptr(head->recs_offset[j]);
208
209 /* Iterate the recs list */
210 while (recs) {
211 rc = validate_recs(j, head, recs);
212 if (rc < 0)
213 goto unlock;
214
215 rc = reserve_nvmpg_recs(recs);
216 if (rc < 0)
217 goto unlock;
218
219 bitmap_set(ns->recs_bitmap, recs - sys_recs, 1);
220 recs = bch_nvmpg_offset_to_ptr(recs->next_offset);
221 }
222 }
223 }
224 unlock:
225 mutex_unlock(&global_nvmpg_set->lock);
226 return rc;
227 }
228
---
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: 66780 bytes --]
reply other threads:[~2021-07-26 19:39 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=202107270326.vDxM0zQP-lkp@intel.com \
--to=lkp@intel.com \
--cc=colyli@suse.de \
--cc=jianpeng.ma@intel.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=qiaowei.ren@intel.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;
as well as URLs for NNTP newsgroup(s).