Re: [PATCH] vhost_net: Convert from atomic_t to refcount_t on vhost_net_ubuf_ref->refcount

From: kernel test robot
Date: Sun Jul 18 2021 - 18:40:06 EST

Hi Xiyu,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on vhost/linux-next]
[also build test WARNING on v5.14-rc1 next-20210716]
[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]

base: linux-next
config: arm64-randconfig-r021-20210718 (attached as .config)
compiler: clang version 13.0.0 ( 5d5b08761f944d5b9822d582378333cc4b36a0a7)
reproduce (this is a W=1 build):
wget -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
git remote add linux-review
git fetch --no-tags linux-review Xiyu-Yang/vhost_net-Convert-from-atomic_t-to-refcount_t-on-vhost_net_ubuf_ref-refcount/20210718-101502
git checkout 8aaf246d79e6bb03b71d9a1a13289f919aa34215
# save the attached .config to linux build tree

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> drivers/vhost/net.c:253:6: warning: ISO C90 forbids mixing declarations and code [-Wdeclaration-after-statement]
int r = refcount_read(&ubufs->refcount);
1 warning generated.

vim +253 drivers/vhost/net.c

250 static int vhost_net_ubuf_put(struct vhost_net_ubuf_ref *ubufs)
251 {
252 refcount_dec(&ubufs->refcount);
> 253 int r = refcount_read(&ubufs->refcount);
254 if (unlikely(!r))
255 wake_up(&ubufs->wait);
256 return r;
257 }

0-DAY CI Kernel Test Service, Intel Corporation

Attachment: .config.gz
Description: application/gzip