Skip to contentSkip to conversation

avr32: fix timer_init() return type

PATCH New Mike Frysinger 4 participants 5 messages Oct 13, 2011 – Nov 29, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 avr32: fix timer_init() return type

The common.h header says this has to return an int, otherwise we get build failures due to mismatched prototype and function definition.

---
 arch/avr32/cpu/interrupts.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
arch/avr32/cpu/interrupts.c +4 -2
index 6681e13..1127580 100644
@@ -107,7 +107,7 @@ static int set_interrupt_handler(unsigned int nr, void (*handler)(void),
 	return 0;
 }
 
-void timer_init(void)
+int timer_init(void)
 {
 	extern void timer_interrupt_handler(void);
 	u64 tmp;
@@ -120,8 +120,10 @@ void timer_init(void)
 	tb_factor = (u32)tmp;
 
 	if (set_interrupt_handler(0, &timer_interrupt_handler, 3))
-		return;
+		return 0;
 
 	/* For all practical purposes, this gives us an overflow interrupt */
 	sysreg_write(COMPARE, 0xffffffff);
+
+	return 0;
 }
Signature · 1 line
1.7.6.1
#1 lore raw

PATCH 1/1 avr32: fix timer_init() return type

Dear Mike,

Am 13.10.2011 07:11, schrieb Mike Frysinger:

Quoted 22 lines

The common.h header says this has to return an int, otherwise we get build failures due to mismatched prototype and function definition.

---
 arch/avr32/cpu/interrupts.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
arch/avr32/cpu/interrupts.c +1 -1
index 6681e13..1127580 100644
@@ -107,7 +107,7 @@ static int set_interrupt_handler(unsigned int nr, void (*handler)(void),
 	return 0;
 }
 
-void timer_init(void)
+int timer_init(void)
 {
 	extern void timer_interrupt_handler(void);
 	u64 tmp;

arch/avr32/cpu/interrupts.c void timer_init(void) · line 123

Quoted 5 lines
arch/avr32/cpu/interrupts.c +1 -1
@@ -120,8 +120,10 @@ void timer_init(void)
 	tb_factor = (u32)tmp;
 
 	if (set_interrupt_handler(0, &timer_interrupt_handler, 3))
-		return;
+		return 0;

NAK, this is an error and should return a negative value (though the return value is currently not evaluated).

BTW there is another patch pending ->
http://patchwork.ozlabs.org/patch/117688/

best regards

Andreas Bie?mann

#2 lore raw

PATCH 1/1 avr32: fix timer_init() return type

Dear Andreas Bie?mann,

Quoted 6 lines

arch/avr32/cpu/interrupts.c void timer_init(void) · line 123

Quoted 3 lines
arch/avr32/cpu/interrupts.c +1 -1
 	if (set_interrupt_handler(0, &timer_interrupt_handler, 3))
-		return;
+		return 0;

NAK, this is an error and should return a negative value (though the return value is currently not evaluated).

Agreed

Quoted 3 lines

BTW there is another patch pending ->
http://patchwork.ozlabs.org/patch/117688/

I'll apply that one in the year 2015 ;)

NO.. its on my list for applying into next

Best Regards,
Reinhard

#3 lore raw

PATCH 1/1 avr32: fix timer_init() return type

Quoted 7 lines · On Thursday 13 October 2011 06:27:38 Reinhard Meyer wrote:

Dear Andreas Bie?mann,

Quoted 2 lines

BTW there is another patch pending ->
http://patchwork.ozlabs.org/patch/117688/

I'll apply that one in the year 2015 ;)

NO.. its on my list for applying into next

WFM
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20111013/1dd36bb2/attachment.pgp

#4 lore raw

PATCH 1/1 avr32: fix timer_init() return type

In reply to Reinhard Meyer

Dear Reinhard,

Am 13.10.2011 12:27, schrieb Reinhard Meyer:

Quoted 11 lines

Dear Andreas Bie?mann,

Quoted 6 lines

arch/avr32/cpu/interrupts.c void timer_init(void) · line 123

Quoted 3 lines
arch/avr32/cpu/interrupts.c +1 -1
 	if (set_interrupt_handler(0, &timer_interrupt_handler, 3))
-		return;
+		return 0;

NAK, this is an error and should return a negative value (though the return value is currently not evaluated).

Agreed

Quoted 1 line
Quoted 6 lines
Quoted 2 lines

BTW there is another patch pending ->
http://patchwork.ozlabs.org/patch/117688/

I'll apply that one in the year 2015 ;)

NO.. its on my list for applying into next

it would be great to get this regression fix (or the other one) in now.

best regards

Andreas Bie?mann