From: kernel test robot <lkp@intel.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [axboe-block:io_uring-rsrc 6/6] io_uring/rsrc.c:1086:22: warning: variable 'offset' set but not used
Date: Wed, 30 Oct 2024 12:58:47 +0800 [thread overview]
Message-ID: <202410301242.hwd3CISE-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git io_uring-rsrc
head: 8b0d733b6f3b938e1fef6b8abc3bc9dcefb73551
commit: 8b0d733b6f3b938e1fef6b8abc3bc9dcefb73551 [6/6] io_uring/rsrc: add request -> io_rsrc_node mapper
config: x86_64-rhel-8.3 (https://download.01.org/0day-ci/archive/20241030/202410301242.hwd3CISE-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241030/202410301242.hwd3CISE-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410301242.hwd3CISE-lkp@intel.com/
All warnings (new ones prefixed by >>):
io_uring/rsrc.c: In function 'io_rsrc_map_request':
>> io_uring/rsrc.c:1086:22: warning: variable 'offset' set but not used [-Wunused-but-set-variable]
1086 | unsigned int offset;
| ^~~~~~
vim +/offset +1086 io_uring/rsrc.c
1078
1079 struct io_rsrc_node *io_rsrc_map_request(struct io_ring_ctx *ctx,
1080 struct request *req,
1081 void (*kbuf_fn)(struct io_rsrc_node *))
1082 {
1083 struct io_mapped_ubuf *imu = NULL;
1084 struct io_rsrc_node *node = NULL;
1085 struct req_iterator rq_iter;
> 1086 unsigned int offset;
1087 struct bio_vec bv;
1088 int nr_bvecs;
1089
1090 if (!bio_has_data(req->bio))
1091 goto out;
1092
1093 nr_bvecs = 0;
1094 rq_for_each_bvec(bv, req, rq_iter)
1095 nr_bvecs++;
1096 if (!nr_bvecs)
1097 goto out;
1098
1099 node = io_rsrc_node_alloc(ctx, IORING_RSRC_KBUFFER);
1100 if (!node)
1101 goto out;
1102 node->buf = NULL;
1103
1104 imu = kvmalloc(struct_size(imu, bvec, nr_bvecs), GFP_NOIO);
1105 if (!imu)
1106 goto out;
1107
1108 imu->ubuf = 0;
1109 imu->len = 0;
1110 if (req->bio != req->biotail) {
1111 int idx = 0;
1112
1113 offset = 0;
1114 rq_for_each_bvec(bv, req, rq_iter) {
1115 imu->bvec[idx++] = bv;
1116 imu->len += bv.bv_len;
1117 }
1118 } else {
1119 struct bio *bio = req->bio;
1120
1121 offset = bio->bi_iter.bi_bvec_done;
1122 imu->bvec[0] = *__bvec_iter_bvec(bio->bi_io_vec, bio->bi_iter);
1123 imu->len = imu->bvec[0].bv_len;
1124 }
1125 imu->nr_bvecs = nr_bvecs;
1126 imu->folio_shift = PAGE_SHIFT;
1127 refcount_set(&imu->refs, 1);
1128 node->buf = imu;
1129 node->kbuf_fn = kbuf_fn;
1130 return node;
1131 out:
1132 if (node)
1133 io_put_rsrc_node(node);
1134 kfree(imu);
1135 return NULL;
1136 }
1137
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-10-30 4:58 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=202410301242.hwd3CISE-lkp@intel.com \
--to=lkp@intel.com \
--cc=axboe@kernel.dk \
--cc=oe-kbuild-all@lists.linux.dev \
/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.