Re: [PATCH] UIO: make MAX_UIO_MAPS configurable by menuconfig

From: kbuild test robot
Date: Fri Mar 06 2020 - 09:56:42 EST


Hi Qiang,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on char-misc/char-misc-testing]
[also build test ERROR on v5.6-rc4 next-20200306]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url: https://github.com/0day-ci/linux/commits/Qiang-Su/UIO-make-MAX_UIO_MAPS-configurable-by-menuconfig/20200306-192239
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 1f836f5b10f2524d33efde47d2b694b861ecf319
config: nds32-randconfig-a001-20200306 (attached as .config)
compiler: nds32le-linux-gcc (GCC) 9.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=9.2.0 make.cross ARCH=nds32

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

All error/warnings (new ones prefixed by >>):

In file included from drivers//uio/uio.c:26:
>> include/linux/uio_driver.h:47:22: error: 'CONFIG_MAX_UIO_MAPS' undeclared here (not in a function); did you mean 'CONFIG_UIO_MAX_UIO_MAPS'?
47 | #define MAX_UIO_MAPS CONFIG_MAX_UIO_MAPS
| ^~~~~~~~~~~~~~~~~~~
>> include/linux/uio_driver.h:102:22: note: in expansion of macro 'MAX_UIO_MAPS'
102 | struct uio_mem mem[MAX_UIO_MAPS];
| ^~~~~~~~~~~~

vim +47 include/linux/uio_driver.h

46
> 47 #define MAX_UIO_MAPS CONFIG_MAX_UIO_MAPS
48
49 struct uio_portio;
50
51 /**
52 * struct uio_port - description of a UIO port region
53 * @name: name of the port region for identification
54 * @start: start of port region
55 * @size: size of port region
56 * @porttype: type of port (see UIO_PORT_* below)
57 * @portio: for use by the UIO core only.
58 */
59 struct uio_port {
60 const char *name;
61 unsigned long start;
62 unsigned long size;
63 int porttype;
64 struct uio_portio *portio;
65 };
66
67 #define MAX_UIO_PORT_REGIONS 5
68
69 struct uio_device {
70 struct module *owner;
71 struct device dev;
72 int minor;
73 atomic_t event;
74 struct fasync_struct *async_queue;
75 wait_queue_head_t wait;
76 struct uio_info *info;
77 struct mutex info_lock;
78 struct kobject *map_dir;
79 struct kobject *portio_dir;
80 };
81
82 /**
83 * struct uio_info - UIO device capabilities
84 * @uio_dev: the UIO device this info belongs to
85 * @name: device name
86 * @version: device driver version
87 * @mem: list of mappable memory regions, size==0 for end of list
88 * @port: list of port regions, size==0 for end of list
89 * @irq: interrupt number or UIO_IRQ_CUSTOM
90 * @irq_flags: flags for request_irq()
91 * @priv: optional private data
92 * @handler: the device's irq handler
93 * @mmap: mmap operation for this uio device
94 * @open: open operation for this uio device
95 * @release: release operation for this uio device
96 * @irqcontrol: disable/enable irqs when 0/1 is written to /dev/uioX
97 */
98 struct uio_info {
99 struct uio_device *uio_dev;
100 const char *name;
101 const char *version;
> 102 struct uio_mem mem[MAX_UIO_MAPS];
103 struct uio_port port[MAX_UIO_PORT_REGIONS];
104 long irq;
105 unsigned long irq_flags;
106 void *priv;
107 irqreturn_t (*handler)(int irq, struct uio_info *dev_info);
108 int (*mmap)(struct uio_info *info, struct vm_area_struct *vma);
109 int (*open)(struct uio_info *info, struct inode *inode);
110 int (*release)(struct uio_info *info, struct inode *inode);
111 int (*irqcontrol)(struct uio_info *info, s32 irq_on);
112 };
113

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

Attachment: .config.gz
Description: application/gzip