[mst-vhost:vhost 5/52] drivers/block/virtio_blk.c:539:21: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast
From: kernel test robot <hidden>
Date: 2022-12-19 14:34:35
Also in:
oe-kbuild-all, virtualization
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git vhost head: ebf31b1807d09448f902d02a0267dd344a194368 commit: b83e3ac7a0ec091edb31afdb1626e86672974670 [5/52] virtio-blk: add support for zoned block devices config: mips-allyesconfig compiler: mips-linux-gcc (GCC) 12.1.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://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git/commit/?id=b83e3ac7a0ec091edb31afdb1626e86672974670 git remote add mst-vhost https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git git fetch --no-tags mst-vhost vhost git checkout b83e3ac7a0ec091edb31afdb1626e86672974670 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=mips olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash drivers/block/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot [off-list ref] All warnings (new ones prefixed by >>): drivers/block/virtio_blk.c: In function 'virtblk_alloc_report_buffer': drivers/block/virtio_blk.c:539:23: error: implicit declaration of function '__vmalloc'; did you mean '__kmalloc'? [-Werror=implicit-function-declaration] 539 | buf = __vmalloc(bufsize, GFP_KERNEL | __GFP_NORETRY); | ^~~~~~~~~ | __kmalloc
quoted
drivers/block/virtio_blk.c:539:21: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
539 | buf = __vmalloc(bufsize, GFP_KERNEL | __GFP_NORETRY);
| ^
cc1: some warnings being treated as errors
vim +539 drivers/block/virtio_blk.c
518
519 #ifdef CONFIG_BLK_DEV_ZONED
520 static void *virtblk_alloc_report_buffer(struct virtio_blk *vblk,
521 unsigned int nr_zones,
522 unsigned int zone_sectors,
523 size_t *buflen)
524 {
525 struct request_queue *q = vblk->disk->queue;
526 size_t bufsize;
527 void *buf;
528
529 nr_zones = min_t(unsigned int, nr_zones,
530 get_capacity(vblk->disk) >> ilog2(zone_sectors));
531
532 bufsize = sizeof(struct virtio_blk_zone_report) +
533 nr_zones * sizeof(struct virtio_blk_zone_descriptor);
534 bufsize = min_t(size_t, bufsize,
535 queue_max_hw_sectors(q) << SECTOR_SHIFT);
536 bufsize = min_t(size_t, bufsize, queue_max_segments(q) << PAGE_SHIFT);
537
538 while (bufsize >= sizeof(struct virtio_blk_zone_report)) {
> 539 buf = __vmalloc(bufsize, GFP_KERNEL | __GFP_NORETRY);
540 if (buf) {
541 *buflen = bufsize;
542 return buf;
543 }
544 bufsize >>= 1;
545 }
546
547 return NULL;
548 }
549
--
0-DAY CI Kernel Test Service
https://01.org/lkp