Skip to contentSkip to conversation

drivers/clocksource/timer-vf-pit.c:194: error: unterminated argument list invoking macro "BUG_ON"

PATCH Applied kbuild test robot 4 participants 6 messages Mar 22, 2020 – Apr 5, 2020 Clocksource, clockevent drivers

lore
Share & tools
lore

kbuild test robot

author build bot
#0 lore raw

Hi afzal,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   d8f289c16fbb72e17b783175c1fb0942816264fd
commit: cc2550b421aa30e3da67e5a7f6d14f3ecd3527b3 [4326/10629] clocksource: Replace setup_irq() by request_irq()
config: arm-vf610m4_defconfig (attached as .config)
compiler: arm-linux-gnueabi-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
git checkout cc2550b421aa30e3da67e5a7f6d14f3ecd3527b3
# save the attached .config to linux build tree
GCC_VERSION=9.2.0 make.cross ARCH=arm

If you fix the issue, kindly add following tag

All errors (new ones prefixed by >>):

drivers/clocksource/timer-vf-pit.c: In function 'pit_clockevent_init':

>> drivers/clocksource/timer-vf-pit.c:194: error: unterminated argument list invoking macro "BUG_ON"
     194 | TIMER_OF_DECLARE(vf610, "fsl,vf610-pit", pit_timer_init);
         | 
>> drivers/clocksource/timer-vf-pit.c:131:2: error: 'BUG_ON' undeclared (first use in this function)
     131 |  BUG_ON(request_irq(irq, pit_timer_interrupt, IRQF_TIMER | IRQF_IRQPOLL,
         |  ^~~~~~
   drivers/clocksource/timer-vf-pit.c:131:2: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/clocksource/timer-vf-pit.c:131:8: error: expected ';' at end of input
     131 |  BUG_ON(request_irq(irq, pit_timer_interrupt, IRQF_TIMER | IRQF_IRQPOLL,
         |        ^
         |        ;
   ......
     194 | TIMER_OF_DECLARE(vf610, "fsl,vf610-pit", pit_timer_init);
         |         
>> drivers/clocksource/timer-vf-pit.c:131:2: error: expected declaration or statement at end of input
     131 |  BUG_ON(request_irq(irq, pit_timer_interrupt, IRQF_TIMER | IRQF_IRQPOLL,
         |  ^~~~~~
   drivers/clocksource/timer-vf-pit.c:131:2: warning: no return statement in function returning non-void [-Wreturn-type]
   At top level:
   drivers/clocksource/timer-vf-pit.c:126:19: warning: 'pit_clockevent_init' defined but not used [-Wunused-function]
     126 | static int __init pit_clockevent_init(unsigned long rate, int irq)
         |                   ^~~~~~~~~~~~~~~~~~~
   drivers/clocksource/timer-vf-pit.c:117:34: warning: 'clockevent_pit' defined but not used [-Wunused-variable]
     117 | static struct clock_event_device clockevent_pit = {
         |                                  ^~~~~~~~~~~~~~

drivers/clocksource/timer-vf-pit.c:97:20: warning: 'pit_timer_interrupt' defined but not used [-Wunused-function]
97 | static irqreturn_t pit_timer_interrupt(int irq, void *dev_id)
| ^~~~~~~~~~~~~~~~~~~
drivers/clocksource/timer-vf-pit.c:56:19: warning: 'pit_clocksource_init' defined but not used [-Wunused-function]
56 | static int __init pit_clocksource_init(unsigned long rate)
| ^~~~~~~~~~~~~~~~~~~~

vim +/BUG_ON +194 drivers/clocksource/timer-vf-pit.c

c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  125  
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  126  static int __init pit_clockevent_init(unsigned long rate, int irq)
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  127  {
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  128  	__raw_writel(0, clkevt_base + PITTCTRL);
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  129  	__raw_writel(PITTFLG_TIF, clkevt_base + PITTFLG);
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  130  
cc2550b421aa30 drivers/clocksource/timer-vf-pit.c afzal mohammed 2020-02-27 @131  	BUG_ON(request_irq(irq, pit_timer_interrupt, IRQF_TIMER | IRQF_IRQPOLL,
cc2550b421aa30 drivers/clocksource/timer-vf-pit.c afzal mohammed 2020-02-27  132  			   "VF pit timer", &clockevent_pit);
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  133  
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  134  	clockevent_pit.cpumask = cpumask_of(0);
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  135  	clockevent_pit.irq = irq;
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  136  	/*
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  137  	 * The value for the LDVAL register trigger is calculated as:
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  138  	 * LDVAL trigger = (period / clock period) - 1
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  139  	 * The pit is a 32-bit down count timer, when the conter value
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  140  	 * reaches 0, it will generate an interrupt, thus the minimal
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  141  	 * LDVAL trigger value is 1. And then the min_delta is
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  142  	 * minimal LDVAL trigger value + 1, and the max_delta is full 32-bit.
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  143  	 */
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  144  	clockevents_config_and_register(&clockevent_pit, rate, 2, 0xffffffff);
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  145  
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  146  	return 0;
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  147  }
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  148  
b71306e62d6a42 drivers/clocksource/vf_pit_timer.c Daniel Lezcano 2016-06-06  149  static int __init pit_timer_init(struct device_node *np)
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  150  {
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  151  	struct clk *pit_clk;
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  152  	void __iomem *timer_base;
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  153  	unsigned long clk_rate;
b71306e62d6a42 drivers/clocksource/vf_pit_timer.c Daniel Lezcano 2016-06-06  154  	int irq, ret;
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  155  
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  156  	timer_base = of_iomap(np, 0);
b71306e62d6a42 drivers/clocksource/vf_pit_timer.c Daniel Lezcano 2016-06-06  157  	if (!timer_base) {
ac9ce6d1a0cc29 drivers/clocksource/vf_pit_timer.c Rafał Miłecki  2017-03-09  158  		pr_err("Failed to iomap\n");
b71306e62d6a42 drivers/clocksource/vf_pit_timer.c Daniel Lezcano 2016-06-06  159  		return -ENXIO;
b71306e62d6a42 drivers/clocksource/vf_pit_timer.c Daniel Lezcano 2016-06-06  160  	}
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  161  
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  162  	/*
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  163  	 * PIT0 and PIT1 can be chained to build a 64-bit timer,
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  164  	 * so choose PIT2 as clocksource, PIT3 as clockevent device,
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  165  	 * and leave PIT0 and PIT1 unused for anyone else who needs them.
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  166  	 */
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  167  	clksrc_base = timer_base + PITn_OFFSET(2);
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  168  	clkevt_base = timer_base + PITn_OFFSET(3);
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  169  
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  170  	irq = irq_of_parse_and_map(np, 0);
b71306e62d6a42 drivers/clocksource/vf_pit_timer.c Daniel Lezcano 2016-06-06  171  	if (irq <= 0)
b71306e62d6a42 drivers/clocksource/vf_pit_timer.c Daniel Lezcano 2016-06-06  172  		return -EINVAL;
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  173  
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  174  	pit_clk = of_clk_get(np, 0);
b71306e62d6a42 drivers/clocksource/vf_pit_timer.c Daniel Lezcano 2016-06-06  175  	if (IS_ERR(pit_clk))
b71306e62d6a42 drivers/clocksource/vf_pit_timer.c Daniel Lezcano 2016-06-06  176  		return PTR_ERR(pit_clk);
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  177  
b71306e62d6a42 drivers/clocksource/vf_pit_timer.c Daniel Lezcano 2016-06-06  178  	ret = clk_prepare_enable(pit_clk);
b71306e62d6a42 drivers/clocksource/vf_pit_timer.c Daniel Lezcano 2016-06-06  179  	if (ret)
b71306e62d6a42 drivers/clocksource/vf_pit_timer.c Daniel Lezcano 2016-06-06  180  		return ret;
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  181  
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  182  	clk_rate = clk_get_rate(pit_clk);
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  183  	cycle_per_jiffy = clk_rate / (HZ);
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  184  
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  185  	/* enable the pit module */
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  186  	__raw_writel(~PITMCR_MDIS, timer_base + PITMCR);
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  187  
b71306e62d6a42 drivers/clocksource/vf_pit_timer.c Daniel Lezcano 2016-06-06  188  	ret = pit_clocksource_init(clk_rate);
b71306e62d6a42 drivers/clocksource/vf_pit_timer.c Daniel Lezcano 2016-06-06  189  	if (ret)
b71306e62d6a42 drivers/clocksource/vf_pit_timer.c Daniel Lezcano 2016-06-06  190  		return ret;
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  191  
b71306e62d6a42 drivers/clocksource/vf_pit_timer.c Daniel Lezcano 2016-06-06  192  	return pit_clockevent_init(clk_rate, irq);
c19672492d233e drivers/clocksource/vf_pit_timer.c Jingchang Lu   2013-05-29  193  }

1727339590fdb5 drivers/clocksource/vf_pit_timer.c Daniel Lezcano 2017-05-26 @194 TIMER_OF_DECLARE(vf610, "fsl,vf610-pit", pit_timer_init);

:::::: The code@line 194 was first introduced by commit
:::::: 1727339590fdb5a1ded881b540cd32121278d414 clocksource/drivers: Rename CLOCKSOURCE_OF_DECLARE to TIMER_OF_DECLARE

:::::: TO: Daniel Lezcano <[email protected]> :::::: CC: Daniel Lezcano <[email protected]>

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

#1 lore raw

PATCH 1/1 clocksource/drivers/timer-vf-pit: Fix build error

Recently all usages of setup_irq() was replaced by request_irq(). The replacement in timer-vf-pit.c missed closing parentheses resulting in build error (vf610m4_defconfig). Fix it.

Fixes cc2550b421aa ("clocksource: Replace setup_irq() by request_irq()")
---
 drivers/clocksource/timer-vf-pit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/timer-vf-pit.c +1 -1
index 7ad4a8b008c2..1a86a4e7e344 100644
@@ -129,7 +129,7 @@ static int __init pit_clockevent_init(unsigned long rate, int irq)
 	__raw_writel(PITTFLG_TIF, clkevt_base + PITTFLG);
 
 	BUG_ON(request_irq(irq, pit_timer_interrupt, IRQF_TIMER | IRQF_IRQPOLL,
-			   "VF pit timer", &clockevent_pit);
+			   "VF pit timer", &clockevent_pit));
 
 	clockevent_pit.cpumask = cpumask_of(0);
 	clockevent_pit.irq = irq;
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH] clocksource/drivers/timer-vf-pit: Fix build error

Quoted 16 lines · afzal mohammed

Recently all usages of setup_irq() was replaced by request_irq(). The replacement in timer-vf-pit.c missed closing parentheses resulting in build error (vf610m4_defconfig). Fix it.

Fixes cc2550b421aa ("clocksource: Replace setup_irq() by request_irq()")
---
 drivers/clocksource/timer-vf-pit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/timer-vf-pit.c +0 -0
index 7ad4a8b008c2..1a86a4e7e344 100644

drivers/clocksource/timer-vf-pit.c static int __init pit_clockevent_init(unsigned long rate, int irq) · line 132

Quoted 5 lines
drivers/clocksource/timer-vf-pit.c +1 -1
@@ -129,7 +129,7 @@ static int __init pit_clockevent_init(unsigned long rate, int irq)
 	__raw_writel(PITTFLG_TIF, clkevt_base + PITTFLG);
 
 	BUG_ON(request_irq(irq, pit_timer_interrupt, IRQF_TIMER | IRQF_IRQPOLL,
-			   "VF pit timer", &clockevent_pit);
+			   "VF pit timer", &clockevent_pit));

Applied

Signature · 5 lines
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
#3 lore raw

Re: [PATCH] clocksource/drivers/timer-vf-pit: Fix build error

In reply to afzal mohammed

Hi Thomas,

I was about to send a PR with the revert and this patch. As you picked up the revert, do you mind to pick also this one?

Thanks

-- Daniel

Quoted 24 lines · afzal mohammed

Recently all usages of setup_irq() was replaced by request_irq(). The replacement in timer-vf-pit.c missed closing parentheses resulting in build error (vf610m4_defconfig). Fix it.

Fixes cc2550b421aa ("clocksource: Replace setup_irq() by

request_irq()") Reported-by: kbuild test robot <[email protected]>

drivers/clocksource/timer-vf-pit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

(quoted diff) +0 -0

b/drivers/clocksource/timer-vf-pit.c index 7ad4a8b008c2..1a86a4e7e344 100644 --- a/drivers/clocksource/timer-vf-pit.c +++ b/drivers/clocksource/timer-vf-pit.c @@ -129,7 +129,7 @@ static int __init pit_clockevent_init(unsigned long rate, int irq) __raw_writel(PITTFLG_TIF, clkevt_base + PITTFLG);

BUG_ON(request_irq(irq, pit_timer_interrupt, IRQF_TIMER |
IRQF_IRQPOLL, - "VF pit timer", &clockevent_pit); + "VF
pit timer", &clockevent_pit));

clockevent_pit.cpumask = cpumask_of(0); clockevent_pit.irq = irq;

Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
#4 lore raw

Re: [PATCH] clocksource/drivers/timer-vf-pit: Fix build error

Hi Daniel, Thomas,

Quoted 4 lines · Daniel Lezcano

Hi Thomas,

I was about to send a PR with the revert and this patch. As you picked up the revert, do you mind to pick also this one?

Mainline is broken w/o this change for ARM vf610m4_defconfig, Stephen Rothwell also reported it today, please do the needful so as to let it reach mainline.

Regards
afzal

Quoted 33 lines · afzal mohammed
Quoted 24 lines

Recently all usages of setup_irq() was replaced by request_irq(). The replacement in timer-vf-pit.c missed closing parentheses resulting in build error (vf610m4_defconfig). Fix it.

Fixes cc2550b421aa ("clocksource: Replace setup_irq() by

request_irq()") Reported-by: kbuild test robot <[email protected]>

drivers/clocksource/timer-vf-pit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

(quoted diff) +0 -0

b/drivers/clocksource/timer-vf-pit.c index 7ad4a8b008c2..1a86a4e7e344 100644 --- a/drivers/clocksource/timer-vf-pit.c +++ b/drivers/clocksource/timer-vf-pit.c @@ -129,7 +129,7 @@ static int __init pit_clockevent_init(unsigned long rate, int irq) __raw_writel(PITTFLG_TIF, clkevt_base + PITTFLG);

BUG_ON(request_irq(irq, pit_timer_interrupt, IRQF_TIMER |
IRQF_IRQPOLL, - "VF pit timer", &clockevent_pit); + "VF
pit timer", &clockevent_pit));

clockevent_pit.cpumask = cpumask_of(0); clockevent_pit.irq = irq;

Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
merge bot Applied
#5 lore raw

[tip: timers/urgent] clocksource/drivers/timer-vf-pit: Add missing parenthesis

In reply to afzal mohammed
The following commit has been merged into the timers/urgent branch of tip:

The following commit has been merged into the timers/urgent branch of tip:

Commit-ID:     760a53768610d427990192b5cfdb71310e1373db
Gitweb:        https://git.kernel.org/tip/760a53768610d427990192b5cfdb71310e1373db
Author:        afzal mohammed <[email protected]>
AuthorDate:    Mon, 23 Mar 2020 11:41:30 +05:30
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Sun, 05 Apr 2020 09:24:58 +02:00

clocksource/drivers/timer-vf-pit: Add missing parenthesis

Recently all usage of setup_irq() was replaced by request_irq(). The replacement in timer-vf-pit.c missed closing parentheses resulting in a build error (vf610m4_defconfig). Fix it.

Fixes cc2550b421aa ("clocksource: Replace setup_irq() by request_irq()")
---
 drivers/clocksource/timer-vf-pit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/timer-vf-pit.c +1 -1
index 7ad4a8b..1a86a4e 100644
@@ -129,7 +129,7 @@ static int __init pit_clockevent_init(unsigned long rate, int irq)
 	__raw_writel(PITTFLG_TIF, clkevt_base + PITTFLG);
 
 	BUG_ON(request_irq(irq, pit_timer_interrupt, IRQF_TIMER | IRQF_IRQPOLL,
-			   "VF pit timer", &clockevent_pit);
+			   "VF pit timer", &clockevent_pit));
 
 	clockevent_pit.cpumask = cpumask_of(0);
 	clockevent_pit.irq = irq;