On Thu, Mar 03, 2022 at 05:08:47PM +0800, kernel test robot wrote: > Hi Ming, > > Thank you for the patch! Perhaps something to improve: > > [auto build test WARNING on axboe-block/for-next] > [also build test WARNING on v5.17-rc6 next-20220302] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch] > > url: https://github.com/0day-ci/linux/commits/Ming-Lei/blk-mq-update_nr_hw_queues-related-improvement-bugfix/20220302-201636 > base: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-next > config: m68k-randconfig-m031-20220302 (https://download.01.org/0day-ci/archive/20220303/202203031651.z0z86F6E-lkp@xxxxxxxxx/config) > compiler: m68k-linux-gcc (GCC) 11.2.0 > > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot <lkp@xxxxxxxxx> > > smatch warnings: > block/blk-mq-sysfs.c:282 __blk_mq_register_dev() warn: always true condition '(--i >= 0) => (0-u32max >= 0)' > block/blk-mq-sysfs.c:282 __blk_mq_register_dev() warn: always true condition '(--i >= 0) => (0-u32max >= 0)' Good catch, will fix it by the following way in V3: diff --git a/block/blk-mq-sysfs.c b/block/blk-mq-sysfs.c index 6a7fb960e046..851faacc2f78 100644 --- a/block/blk-mq-sysfs.c +++ b/block/blk-mq-sysfs.c @@ -279,8 +279,8 @@ int __blk_mq_register_dev(struct device *dev, struct request_queue *q) return ret; unreg: - while (--i >= 0) - blk_mq_unregister_hctx(xa_load(&q->hctx_table, i)); + queue_for_each_hw_ctx(q, hctx, i) { + blk_mq_unregister_hctx(hctx); kobject_uevent(q->mq_kobj, KOBJ_REMOVE); kobject_del(q->mq_kobj); Thanks, Ming