Hi Luis,
I love your patch! Yet something to improve:
[auto build test ERROR on block/for-next]
[also build test ERROR on v5.14-rc1 next-20210715]
[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/Luis-Chamberlain/block-simple-ad...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-next
config: h8300-randconfig-r032-20210715 (attached as .config)
compiler: h8300-linux-gcc (GCC) 10.3.0
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
#
https://github.com/0day-ci/linux/commit/bc7835fa74d828de37e4f8a676d8dd451...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Luis-Chamberlain/block-simple-add_disk-driver-conversions/20210716-035618
git checkout bc7835fa74d828de37e4f8a676d8dd45160299db
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir
ARCH=h8300 SHELL=/bin/bash drivers/block/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/kernel.h:11,
from include/linux/list.h:9,
from include/linux/module.h:12,
from drivers/block/loop.c:52:
include/linux/scatterlist.h: In function 'sg_set_buf':
include/asm-generic/page.h:89:50: warning: ordered comparison of pointer with null
pointer [-Wextra]
89 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET)
&& \
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:137:2: note: in expansion of macro 'BUG_ON'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:137:10: note: in expansion of macro
'virt_addr_valid'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
drivers/block/loop.c: In function 'loop_add':
> drivers/block/loop.c:2330:6: error: void value not ignored as it
ought to be
2330 | err = add_disk(disk);
| ^
vim +2330 drivers/block/loop.c
2237
2238 static int loop_add(int i)
2239 {
2240 struct loop_device *lo;
2241 struct gendisk *disk;
2242 int err;
2243
2244 err = -ENOMEM;
2245 lo = kzalloc(sizeof(*lo), GFP_KERNEL);
2246 if (!lo)
2247 goto out;
2248 lo->lo_state = Lo_unbound;
2249
2250 err = mutex_lock_killable(&loop_ctl_mutex);
2251 if (err)
2252 goto out_free_dev;
2253
2254 /* allocate id, if @id >= 0, we're requesting that specific id */
2255 if (i >= 0) {
2256 err = idr_alloc(&loop_index_idr, lo, i, i + 1, GFP_KERNEL);
2257 if (err == -ENOSPC)
2258 err = -EEXIST;
2259 } else {
2260 err = idr_alloc(&loop_index_idr, lo, 0, 0, GFP_KERNEL);
2261 }
2262 if (err < 0)
2263 goto out_unlock;
2264 i = err;
2265
2266 err = -ENOMEM;
2267 lo->tag_set.ops = &loop_mq_ops;
2268 lo->tag_set.nr_hw_queues = 1;
2269 lo->tag_set.queue_depth = 128;
2270 lo->tag_set.numa_node = NUMA_NO_NODE;
2271 lo->tag_set.cmd_size = sizeof(struct loop_cmd);
2272 lo->tag_set.flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_STACKING;
2273 lo->tag_set.driver_data = lo;
2274
2275 err = blk_mq_alloc_tag_set(&lo->tag_set);
2276 if (err)
2277 goto out_free_idr;
2278
2279 disk = lo->lo_disk = blk_mq_alloc_disk(&lo->tag_set, lo);
2280 if (IS_ERR(disk)) {
2281 err = PTR_ERR(disk);
2282 goto out_cleanup_tags;
2283 }
2284 lo->lo_queue = lo->lo_disk->queue;
2285
2286 blk_queue_max_hw_sectors(lo->lo_queue, BLK_DEF_MAX_SECTORS);
2287
2288 /*
2289 * By default, we do buffer IO, so it doesn't make sense to enable
2290 * merge because the I/O submitted to backing file is handled page by
2291 * page. For directio mode, merge does help to dispatch bigger request
2292 * to underlayer disk. We will enable merge once directio is enabled.
2293 */
2294 blk_queue_flag_set(QUEUE_FLAG_NOMERGES, lo->lo_queue);
2295
2296 /*
2297 * Disable partition scanning by default. The in-kernel partition
2298 * scanning can be requested individually per-device during its
2299 * setup. Userspace can always add and remove partitions from all
2300 * devices. The needed partition minors are allocated from the
2301 * extended minor space, the main loop device numbers will continue
2302 * to match the loop minors, regardless of the number of partitions
2303 * used.
2304 *
2305 * If max_part is given, partition scanning is globally enabled for
2306 * all loop devices. The minors for the main loop devices will be
2307 * multiples of max_part.
2308 *
2309 * Note: Global-for-all-devices, set-only-at-init, read-only module
2310 * parameteters like 'max_loop' and 'max_part' make things
needlessly
2311 * complicated, are too static, inflexible and may surprise
2312 * userspace tools. Parameters like this in general should be avoided.
2313 */
2314 if (!part_shift)
2315 disk->flags |= GENHD_FL_NO_PART_SCAN;
2316 disk->flags |= GENHD_FL_EXT_DEVT;
2317 atomic_set(&lo->lo_refcnt, 0);
2318 mutex_init(&lo->lo_mutex);
2319 lo->lo_number = i;
2320 spin_lock_init(&lo->lo_lock);
2321 spin_lock_init(&lo->lo_work_lock);
2322 disk->major = LOOP_MAJOR;
2323 disk->first_minor = i << part_shift;
2324 disk->minors = 1 << part_shift;
2325 disk->fops = &lo_fops;
2326 disk->private_data = lo;
2327 disk->queue = lo->lo_queue;
2328 sprintf(disk->disk_name, "loop%d", i);
2329
2330 err = add_disk(disk);
2331 if (err)
2332 goto out_cleanup_disk;
2333
2334 mutex_unlock(&loop_ctl_mutex);
2335
2336 return i;
2337
2338 out_cleanup_disk:
2339 blk_cleanup_disk(disk);
2340 out_cleanup_tags:
2341 blk_mq_free_tag_set(&lo->tag_set);
2342 out_free_idr:
2343 idr_remove(&loop_index_idr, i);
2344 out_unlock:
2345 mutex_unlock(&loop_ctl_mutex);
2346 out_free_dev:
2347 kfree(lo);
2348 out:
2349 return err;
2350 }
2351
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org