RE: [PATCH 2/2] clocksource: Make clocksource register functions void

From
David Laight <hidden>
Date
2014-01-23 11:40:35
Also in
linux-arm-kernel, linux-arm-msm, linux-mips, linux-omap, linux-samsung-soc, linux-um
Reply to
Tony Prisk, 2014-01-23
From: Linuxppc-dev Tony Prisk
On 23/01/14 20:12, Yijing Wang wrote:
quoted
Currently, clocksource_register() and __clocksource_register_scale()
functions always return 0, it's pointless, make functions void.
And remove the dead code that check the clocksource_register_hz()
return value.
......
quoted
-static inline int clocksource_register_hz(struct clocksource *cs, u32 =
hz)
quoted
+static inline void clocksource_register_hz(struct clocksource *cs, u32=
 hz)
quoted
  {
  	return __clocksource_register_scale(cs, 1, hz);
  }
=20
This doesn't make sense - you are still returning a value on a function
declared void, and the return is now from a function that doesn't return
anything either ?!?!
Doesn't this throw a compile-time warning??
It depends on the compiler.
Recent gcc allow it.
I don't know if it is actually valid C though.

There is no excuse for it on lines like the above though.

	David
Thread (11 messages) 11 messages, 7 authors, last reply 2014-02-10
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help