drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c:16:5: warning: no previous prototype for function 'vfio_fsl_mc_irqs_allocate'

From: kernel test robot
Date: Fri Oct 23 2020 - 21:16:16 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: b76f733c3ff83089cf1e3f9ae233533649f999b3
commit: cc0ee20bd96971c10eba9a83ecf1c0733078a083 vfio/fsl-mc: trigger an interrupt via eventfd
date: 11 days ago
config: arm64-randconfig-r001-20201024 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 77cbf2595331b11018c2cffb76eb5b8db69f4577)
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
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cc0ee20bd96971c10eba9a83ecf1c0733078a083
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout cc0ee20bd96971c10eba9a83ecf1c0733078a083
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64

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/vfio/fsl-mc/vfio_fsl_mc_intr.c:16:5: warning: no previous prototype for function 'vfio_fsl_mc_irqs_allocate' [-Wmissing-prototypes]
int vfio_fsl_mc_irqs_allocate(struct vfio_fsl_mc_device *vdev)
^
drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c:16:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int vfio_fsl_mc_irqs_allocate(struct vfio_fsl_mc_device *vdev)
^
static
drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c:121:8: error: implicit declaration of function 'fsl_mc_populate_irq_pool' [-Werror,-Wimplicit-function-declaration]
ret = fsl_mc_populate_irq_pool(mc_cont,
^
drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c:122:4: error: use of undeclared identifier 'FSL_MC_IRQ_POOL_MAX_TOTAL_IRQS'
FSL_MC_IRQ_POOL_MAX_TOTAL_IRQS);
^
1 warning and 2 errors generated.

vim +/vfio_fsl_mc_irqs_allocate +16 drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c

15
> 16 int vfio_fsl_mc_irqs_allocate(struct vfio_fsl_mc_device *vdev)
17 {
18 struct fsl_mc_device *mc_dev = vdev->mc_dev;
19 struct vfio_fsl_mc_irq *mc_irq;
20 int irq_count;
21 int ret, i;
22
23 /* Device does not support any interrupt */
24 if (mc_dev->obj_desc.irq_count == 0)
25 return 0;
26
27 /* interrupts were already allocated for this device */
28 if (vdev->mc_irqs)
29 return 0;
30
31 irq_count = mc_dev->obj_desc.irq_count;
32
33 mc_irq = kcalloc(irq_count, sizeof(*mc_irq), GFP_KERNEL);
34 if (!mc_irq)
35 return -ENOMEM;
36
37 /* Allocate IRQs */
38 ret = fsl_mc_allocate_irqs(mc_dev);
39 if (ret) {
40 kfree(mc_irq);
41 return ret;
42 }
43
44 for (i = 0; i < irq_count; i++) {
45 mc_irq[i].count = 1;
46 mc_irq[i].flags = VFIO_IRQ_INFO_EVENTFD;
47 }
48
49 vdev->mc_irqs = mc_irq;
50
51 return 0;
52 }
53

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip