From: kernel test robot <lkp@intel.com>
To: jason.zeng@intel.com
Cc: oe-kbuild-all@lists.linux.dev
Subject: [bytedance:5.15-velinux 146/146] block/blk-mq.c:324:26: sparse: sparse: incorrect type in assignment (different base types)
Date: Tue, 23 Sep 2025 05:08:25 +0800 [thread overview]
Message-ID: <202509230528.nXmIOXXP-lkp@intel.com> (raw)
tree: https://github.com/bytedance/kernel.git 5.15-velinux
head: c73db7ebb024f59416db0cf136dc2d4b9dbc3695
commit: b0e21ed5b9412dbf0d10b4a027fe130ac0ec166f [146/146] block: cache rq_flags inside blk_mq_rq_ctx_init()
config: arm64-randconfig-r113-20250923 (https://download.01.org/0day-ci/archive/20250923/202509230528.nXmIOXXP-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250923/202509230528.nXmIOXXP-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/202509230528.nXmIOXXP-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> block/blk-mq.c:324:26: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int rq_flags @@ got restricted req_flags_t [usertype] @@
block/blk-mq.c:324:26: sparse: expected unsigned int rq_flags
block/blk-mq.c:324:26: sparse: got restricted req_flags_t [usertype]
>> block/blk-mq.c:333:26: sparse: sparse: invalid assignment: |=
block/blk-mq.c:333:26: sparse: left side has type unsigned int
block/blk-mq.c:333:26: sparse: right side has type restricted req_flags_t
block/blk-mq.c:335:26: sparse: sparse: invalid assignment: |=
block/blk-mq.c:335:26: sparse: left side has type unsigned int
block/blk-mq.c:335:26: sparse: right side has type restricted req_flags_t
>> block/blk-mq.c:336:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted req_flags_t [usertype] rq_flags @@ got unsigned int rq_flags @@
block/blk-mq.c:336:22: sparse: expected restricted req_flags_t [usertype] rq_flags
block/blk-mq.c:336:22: sparse: got unsigned int rq_flags
vim +324 block/blk-mq.c
311
312 static struct request *blk_mq_rq_ctx_init(struct blk_mq_alloc_data *data,
313 unsigned int tag, u64 alloc_time_ns)
314 {
315 struct blk_mq_ctx *ctx = data->ctx;
316 struct blk_mq_hw_ctx *hctx = data->hctx;
317 struct request_queue *q = data->q;
318 struct elevator_queue *e = q->elevator;
319 struct blk_mq_tags *tags = blk_mq_tags_from_data(data);
320 struct request *rq = tags->static_rqs[tag];
321 unsigned int rq_flags = 0;
322
323 if (e) {
> 324 rq_flags = RQF_ELV;
325 rq->tag = BLK_MQ_NO_TAG;
326 rq->internal_tag = tag;
327 } else {
328 rq->tag = tag;
329 rq->internal_tag = BLK_MQ_NO_TAG;
330 }
331
332 if (data->flags & BLK_MQ_REQ_PM)
> 333 rq_flags |= RQF_PM;
334 if (blk_queue_io_stat(q))
335 rq_flags |= RQF_IO_STAT;
> 336 rq->rq_flags = rq_flags;
337
338 if (blk_mq_need_time_stamp(rq))
339 rq->start_time_ns = ktime_get_ns();
340 else
341 rq->start_time_ns = 0;
342 /* csd/requeue_work/fifo_time is initialized before use */
343 rq->q = q;
344 rq->mq_ctx = ctx;
345 rq->mq_hctx = hctx;
346 rq->cmd_flags = data->cmd_flags;
347 rq->rq_disk = NULL;
348 rq->part = NULL;
349 #ifdef CONFIG_BLK_RQ_ALLOC_TIME
350 rq->alloc_time_ns = alloc_time_ns;
351 #endif
352 rq->io_start_time_ns = 0;
353 rq->stats_sectors = 0;
354 rq->nr_phys_segments = 0;
355 #if defined(CONFIG_BLK_DEV_INTEGRITY)
356 rq->nr_integrity_segments = 0;
357 #endif
358 rq->timeout = 0;
359 rq->end_io = NULL;
360 rq->end_io_data = NULL;
361
362 data->ctx->rq_dispatched[op_is_sync(data->cmd_flags)]++;
363 blk_crypto_rq_set_defaults(rq);
364 INIT_LIST_HEAD(&rq->queuelist);
365 /* tag was already set */
366 WRITE_ONCE(rq->deadline, 0);
367 refcount_set(&rq->ref, 1);
368
369 if (rq->rq_flags & RQF_ELV) {
370 struct elevator_queue *e = data->q->elevator;
371
372 rq->elv.icq = NULL;
373 INIT_HLIST_NODE(&rq->hash);
374 RB_CLEAR_NODE(&rq->rb_node);
375
376 if (!op_is_flush(data->cmd_flags) &&
377 e->type->ops.prepare_request) {
378 if (e->type->icq_cache)
379 blk_mq_sched_assign_ioc(rq);
380
381 e->type->ops.prepare_request(rq);
382 rq->rq_flags |= RQF_ELVPRIV;
383 }
384 }
385
386 data->hctx->queued++;
387 return rq;
388 }
389
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2025-09-22 21:09 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=202509230528.nXmIOXXP-lkp@intel.com \
--to=lkp@intel.com \
--cc=jason.zeng@intel.com \
--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.