[arm-platforms:irq/irqchip-next 41/43] drivers/irqchip/irq-mtk-sysirq.c:236:1: warning: parameter names (without types) in function declaration

kernel test robot lkp at intel.com
Sun Jul 26 05:18:34 EDT 2020


tree:   https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git irq/irqchip-next
head:   99e05524bc722c8d3c1ab9c817afcb6829dbded3
commit: 3ae3022690e6787839dafa8ea3496450248b53e1 [41/43] irqchip/mtk-sysirq: Convert to a platform driver
config: arm-defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.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
        git checkout 3ae3022690e6787839dafa8ea3496450248b53e1
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>

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

   In file included from drivers/irqchip/irq-mtk-sysirq.c:8:
>> include/linux/irqchip.h:40:1: warning: data definition has no type or storage class
      40 | MODULE_DEVICE_TABLE(of, drv_name##_irqchip_match_table);  \
         | ^~~~~~~~~~~~~~~~~~~
   drivers/irqchip/irq-mtk-sysirq.c:236:1: note: in expansion of macro 'IRQCHIP_PLATFORM_DRIVER_END'
     236 | IRQCHIP_PLATFORM_DRIVER_END(mtk_sysirq)
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/irqchip.h:40:1: error: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE' [-Werror=implicit-int]
      40 | MODULE_DEVICE_TABLE(of, drv_name##_irqchip_match_table);  \
         | ^~~~~~~~~~~~~~~~~~~
   drivers/irqchip/irq-mtk-sysirq.c:236:1: note: in expansion of macro 'IRQCHIP_PLATFORM_DRIVER_END'
     236 | IRQCHIP_PLATFORM_DRIVER_END(mtk_sysirq)
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/irqchip/irq-mtk-sysirq.c:236:1: warning: parameter names (without types) in function declaration
   cc1: some warnings being treated as errors

vim +236 drivers/irqchip/irq-mtk-sysirq.c

   121	
   122	static int __init mtk_sysirq_of_init(struct device_node *node,
   123					     struct device_node *parent)
   124	{
   125		struct irq_domain *domain, *domain_parent;
   126		struct mtk_sysirq_chip_data *chip_data;
   127		int ret, size, intpol_num = 0, nr_intpol_bases = 0, i = 0;
   128	
   129		domain_parent = irq_find_host(parent);
   130		if (!domain_parent) {
   131			pr_err("mtk_sysirq: interrupt-parent not found\n");
   132			return -EINVAL;
   133		}
   134	
   135		chip_data = kzalloc(sizeof(*chip_data), GFP_KERNEL);
   136		if (!chip_data)
   137			return -ENOMEM;
   138	
   139		while (of_get_address(node, i++, NULL, NULL))
   140			nr_intpol_bases++;
   141	
   142		if (nr_intpol_bases == 0) {
   143			pr_err("mtk_sysirq: base address not specified\n");
   144			ret = -EINVAL;
   145			goto out_free_chip;
   146		}
   147	
   148		chip_data->intpol_words = kcalloc(nr_intpol_bases,
   149						  sizeof(*chip_data->intpol_words),
   150						  GFP_KERNEL);
   151		if (!chip_data->intpol_words) {
   152			ret = -ENOMEM;
   153			goto out_free_chip;
   154		}
   155	
   156		chip_data->intpol_bases = kcalloc(nr_intpol_bases,
   157						  sizeof(*chip_data->intpol_bases),
   158						  GFP_KERNEL);
   159		if (!chip_data->intpol_bases) {
   160			ret = -ENOMEM;
   161			goto out_free_intpol_words;
   162		}
   163	
   164		for (i = 0; i < nr_intpol_bases; i++) {
   165			struct resource res;
   166	
   167			ret = of_address_to_resource(node, i, &res);
   168			size = resource_size(&res);
   169			intpol_num += size * 8;
   170			chip_data->intpol_words[i] = size / 4;
   171			chip_data->intpol_bases[i] = of_iomap(node, i);
   172			if (ret || !chip_data->intpol_bases[i]) {
   173				pr_err("%pOF: couldn't map region %d\n", node, i);
   174				ret = -ENODEV;
   175				goto out_free_intpol;
   176			}
   177		}
   178	
   179		chip_data->intpol_idx = kcalloc(intpol_num,
   180						sizeof(*chip_data->intpol_idx),
   181						GFP_KERNEL);
   182		if (!chip_data->intpol_idx) {
   183			ret = -ENOMEM;
   184			goto out_free_intpol;
   185		}
   186	
   187		chip_data->which_word = kcalloc(intpol_num,
   188						sizeof(*chip_data->which_word),
   189						GFP_KERNEL);
   190		if (!chip_data->which_word) {
   191			ret = -ENOMEM;
   192			goto out_free_intpol_idx;
   193		}
   194	
   195		/*
   196		 * assign an index of the intpol_bases for each irq
   197		 * to set it fast later
   198		 */
   199		for (i = 0; i < intpol_num ; i++) {
   200			u32 word = i / 32, j;
   201	
   202			for (j = 0; word >= chip_data->intpol_words[j] ; j++)
   203				word -= chip_data->intpol_words[j];
   204	
   205			chip_data->intpol_idx[i] = j;
   206			chip_data->which_word[i] = word;
   207		}
   208	
   209		domain = irq_domain_add_hierarchy(domain_parent, 0, intpol_num, node,
   210						  &sysirq_domain_ops, chip_data);
   211		if (!domain) {
   212			ret = -ENOMEM;
   213			goto out_free_which_word;
   214		}
   215		raw_spin_lock_init(&chip_data->lock);
   216	
   217		return 0;
   218	
   219	out_free_which_word:
   220		kfree(chip_data->which_word);
   221	out_free_intpol_idx:
   222		kfree(chip_data->intpol_idx);
   223	out_free_intpol:
   224		for (i = 0; i < nr_intpol_bases; i++)
   225			if (chip_data->intpol_bases[i])
   226				iounmap(chip_data->intpol_bases[i]);
   227		kfree(chip_data->intpol_bases);
   228	out_free_intpol_words:
   229		kfree(chip_data->intpol_words);
   230	out_free_chip:
   231		kfree(chip_data);
   232		return ret;
   233	}
   234	IRQCHIP_PLATFORM_DRIVER_BEGIN(mtk_sysirq)
   235	IRQCHIP_MATCH("mediatek,mt6577-sysirq", mtk_sysirq_of_init)
 > 236	IRQCHIP_PLATFORM_DRIVER_END(mtk_sysirq)

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 52664 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20200726/b67c6ad3/attachment-0001.gz>


More information about the linux-arm-kernel mailing list