linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [arm-platforms:irq/irqchip-next 41/43] drivers/irqchip/irq-mtk-sysirq.c:236:1: warning: parameter names (without types) in function declaration
@ 2020-07-26  9:18 kernel test robot
  2020-07-26 10:25 ` Marc Zyngier
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2020-07-26  9:18 UTC (permalink / raw)
  To: Saravana Kannan; +Cc: Marc Zyngier, Hanks Chen, kbuild-all, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 5731 bytes --]

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@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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 52664 bytes --]

[-- Attachment #3: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [arm-platforms:irq/irqchip-next 41/43] drivers/irqchip/irq-mtk-sysirq.c:236:1: warning: parameter names (without types) in function declaration
  2020-07-26  9:18 [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
@ 2020-07-26 10:25 ` Marc Zyngier
  2020-07-27 22:34   ` Saravana Kannan
  0 siblings, 1 reply; 3+ messages in thread
From: Marc Zyngier @ 2020-07-26 10:25 UTC (permalink / raw)
  To: kernel test robot, Saravana Kannan
  Cc: kernel-team, Hanks Chen, kbuild-all, linux-arm-kernel

On Sun, 26 Jul 2020 10:18:34 +0100,
kernel test robot <lkp@intel.com> wrote:
> 
> [1  <text/plain; us-ascii (7bit)>]
> 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@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

Thanks for the heads up.

The patch introducing the new macros fails to include linux/module.h
(arm64 gets away with it by luck, while arm fails to compile).

I'm fixing it with the patch below.

	M.

From 691d1b3962ff7d434eefcd991e6e7bd629379625 Mon Sep 17 00:00:00 2001
From: Marc Zyngier <maz@kernel.org>
Date: Sun, 26 Jul 2020 11:12:36 +0100
Subject: [PATCH] irqchip: Fix IRQCHIP_PLATFORM_DRIVER_* compilation by
 including module.h

The newly introduced IRQCHIP_PLATFORM_DRIVER_* macros expand into
module-related macros, but do so without including module.h.
Depending on the driver and/or architecture, this happens to work,
or not.

Unconditionnaly include linux/module.h to sort it out.

Fixes: f3b5e608ed6d ("irqchip: Add IRQCHIP_PLATFORM_DRIVER_BEGIN/END and IRQCHIP_MATCH helper macros")
Reported-by: kernel test robot <lkp@intel.com>
Cc: Saravana Kannan <saravanak@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
---
 include/linux/irqchip.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/irqchip.h b/include/linux/irqchip.h
index 8e754d8b8155..67351aac65ef 100644
--- a/include/linux/irqchip.h
+++ b/include/linux/irqchip.h
@@ -12,6 +12,7 @@
 #define _LINUX_IRQCHIP_H
 
 #include <linux/acpi.h>
+#include <linux/module.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
 
-- 
2.27.0


-- 
Without deviation from the norm, progress is not possible.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [arm-platforms:irq/irqchip-next 41/43] drivers/irqchip/irq-mtk-sysirq.c:236:1: warning: parameter names (without types) in function declaration
  2020-07-26 10:25 ` Marc Zyngier
@ 2020-07-27 22:34   ` Saravana Kannan
  0 siblings, 0 replies; 3+ messages in thread
From: Saravana Kannan @ 2020-07-27 22:34 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: Android Kernel Team, Hanks Chen, kbuild-all, kernel test robot,
	linux-arm-kernel

On Sun, Jul 26, 2020 at 3:25 AM Marc Zyngier <maz@kernel.org> wrote:
>
> On Sun, 26 Jul 2020 10:18:34 +0100,
> kernel test robot <lkp@intel.com> wrote:
> >
> > [1  <text/plain; us-ascii (7bit)>]
> > 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@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
>
> Thanks for the heads up.
>
> The patch introducing the new macros fails to include linux/module.h
> (arm64 gets away with it by luck, while arm fails to compile).
>
> I'm fixing it with the patch below.
>
>         M.
>
> From 691d1b3962ff7d434eefcd991e6e7bd629379625 Mon Sep 17 00:00:00 2001
> From: Marc Zyngier <maz@kernel.org>
> Date: Sun, 26 Jul 2020 11:12:36 +0100
> Subject: [PATCH] irqchip: Fix IRQCHIP_PLATFORM_DRIVER_* compilation by
>  including module.h
>
> The newly introduced IRQCHIP_PLATFORM_DRIVER_* macros expand into
> module-related macros, but do so without including module.h.
> Depending on the driver and/or architecture, this happens to work,
> or not.
>
> Unconditionnaly include linux/module.h to sort it out.
>
> Fixes: f3b5e608ed6d ("irqchip: Add IRQCHIP_PLATFORM_DRIVER_BEGIN/END and IRQCHIP_MATCH helper macros")
> Reported-by: kernel test robot <lkp@intel.com>
> Cc: Saravana Kannan <saravanak@google.com>
> Signed-off-by: Marc Zyngier <maz@kernel.org>
> ---
>  include/linux/irqchip.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/include/linux/irqchip.h b/include/linux/irqchip.h
> index 8e754d8b8155..67351aac65ef 100644
> --- a/include/linux/irqchip.h
> +++ b/include/linux/irqchip.h
> @@ -12,6 +12,7 @@
>  #define _LINUX_IRQCHIP_H
>
>  #include <linux/acpi.h>
> +#include <linux/module.h>
>  #include <linux/of.h>
>  #include <linux/platform_device.h>

Thanks for the fix and sorry about the bug.

-Saravana

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-27 22:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-26  9:18 [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
2020-07-26 10:25 ` Marc Zyngier
2020-07-27 22:34   ` Saravana Kannan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).