All of lore.kernel.org
 help / color / mirror / Atom feed
* [axboe-block:io_uring-rsrc 6/6] io_uring/rsrc.c:1086:22: warning: variable 'offset' set but not used
@ 2024-10-30  4:58 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-10-30  4:58 UTC (permalink / raw)
  To: Jens Axboe; +Cc: oe-kbuild-all

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-10-30  4:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-30  4:58 [axboe-block:io_uring-rsrc 6/6] io_uring/rsrc.c:1086:22: warning: variable 'offset' set but not used kernel test robot

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.