From: kernel test robot <lkp@intel.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
Sagi Grimberg <sagi@grimberg.me>
Subject: [bvanassche:block-bitwise-opf 38/64] drivers/nvme/target/zns.c:528:25: warning: unused variable 'opf'
Date: Thu, 14 Jul 2022 10:41:14 +0800 [thread overview]
Message-ID: <202207141030.TdBQc2va-lkp@intel.com> (raw)
tree: https://github.com/bvanassche/linux block-bitwise-opf
head: a18eedf7d10c719e2da2a802964f8aaade09e72c
commit: 5d612f7990f6438fe5d09c30560c0e25a1d292a2 [38/64] nvme/target: Use the new blk_opf_t type
config: x86_64-randconfig-a002 (https://download.01.org/0day-ci/archive/20220714/202207141030.TdBQc2va-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/bvanassche/linux/commit/5d612f7990f6438fe5d09c30560c0e25a1d292a2
git remote add bvanassche https://github.com/bvanassche/linux
git fetch --no-tags bvanassche block-bitwise-opf
git checkout 5d612f7990f6438fe5d09c30560c0e25a1d292a2
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/nvme/target/
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 >>):
drivers/nvme/target/zns.c: In function 'nvmet_bdev_execute_zone_append':
drivers/nvme/target/zns.c:559:56: error: 'op' undeclared (first use in this function); did you mean 'opf'?
559 | ARRAY_SIZE(req->inline_bvec), op);
| ^~
| opf
drivers/nvme/target/zns.c:559:56: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/nvme/target/zns.c:528:25: warning: unused variable 'opf' [-Wunused-variable]
528 | const blk_opf_t opf = REQ_OP_ZONE_APPEND | REQ_SYNC | REQ_IDLE;
| ^~~
vim +/opf +528 drivers/nvme/target/zns.c
524
525 void nvmet_bdev_execute_zone_append(struct nvmet_req *req)
526 {
527 sector_t sect = nvmet_lba_to_sect(req->ns, req->cmd->rw.slba);
> 528 const blk_opf_t opf = REQ_OP_ZONE_APPEND | REQ_SYNC | REQ_IDLE;
529 u16 status = NVME_SC_SUCCESS;
530 unsigned int total_len = 0;
531 struct scatterlist *sg;
532 struct bio *bio;
533 int sg_cnt;
534
535 /* Request is completed on len mismatch in nvmet_check_transter_len() */
536 if (!nvmet_check_transfer_len(req, nvmet_rw_data_len(req)))
537 return;
538
539 if (!req->sg_cnt) {
540 nvmet_req_complete(req, 0);
541 return;
542 }
543
544 if (sect >= get_capacity(req->ns->bdev->bd_disk)) {
545 req->error_loc = offsetof(struct nvme_rw_command, slba);
546 status = NVME_SC_LBA_RANGE | NVME_SC_DNR;
547 goto out;
548 }
549
550 if (sect & (bdev_zone_sectors(req->ns->bdev) - 1)) {
551 req->error_loc = offsetof(struct nvme_rw_command, slba);
552 status = NVME_SC_INVALID_FIELD | NVME_SC_DNR;
553 goto out;
554 }
555
556 if (nvmet_use_inline_bvec(req)) {
557 bio = &req->z.inline_bio;
558 bio_init(bio, req->ns->bdev, req->inline_bvec,
559 ARRAY_SIZE(req->inline_bvec), op);
560 } else {
561 bio = bio_alloc(req->ns->bdev, req->sg_cnt, op, GFP_KERNEL);
562 }
563
564 bio->bi_end_io = nvmet_bdev_zone_append_bio_done;
565 bio->bi_iter.bi_sector = sect;
566 bio->bi_private = req;
567 if (req->cmd->rw.control & cpu_to_le16(NVME_RW_FUA))
568 bio->bi_opf |= REQ_FUA;
569
570 for_each_sg(req->sg, sg, req->sg_cnt, sg_cnt) {
571 struct page *p = sg_page(sg);
572 unsigned int l = sg->length;
573 unsigned int o = sg->offset;
574 unsigned int ret;
575
576 ret = bio_add_zone_append_page(bio, p, l, o);
577 if (ret != sg->length) {
578 status = NVME_SC_INTERNAL;
579 goto out_put_bio;
580 }
581 total_len += sg->length;
582 }
583
584 if (total_len != nvmet_rw_data_len(req)) {
585 status = NVME_SC_INTERNAL | NVME_SC_DNR;
586 goto out_put_bio;
587 }
588
589 submit_bio(bio);
590 return;
591
592 out_put_bio:
593 nvmet_req_bio_put(req, bio);
594 out:
595 nvmet_req_complete(req, status);
596 }
597
--
0-DAY CI Kernel Test Service
https://01.org/lkp
next reply other threads:[~2022-07-14 2:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-14 2:41 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-07-14 2:41 [bvanassche:block-bitwise-opf 38/64] drivers/nvme/target/zns.c:528:25: warning: unused variable 'opf' 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=202207141030.TdBQc2va-lkp@intel.com \
--to=lkp@intel.com \
--cc=bvanassche@acm.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sagi@grimberg.me \
/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.