Re: [uml-devel] [PATCH 2/2] clocksource: Make clocksource register functions void
Yijing, On Thu, 23 Jan 2014, David Laight wrote: > From: Linuxppc-dev Tony Prisk > > On 23/01/14 20:12, Yijing Wang wrote: > > > 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. > > .. > > > -static inline int clocksource_register_hz(struct clocksource *cs, u32 hz) > > > +static inline void clocksource_register_hz(struct clocksource *cs, u32 > > > hz) > > > { > > > return __clocksource_register_scale(cs, 1, hz); > > > } > > > > 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. Can you please resend with that fixed against 3.14-rc1 ? Thanks, tglx -- Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] [PATCH 2/2] clocksource: Make clocksource register functions void
On Thu, 23 Jan 2014, Daniel Lezcano wrote: > On 01/23/2014 08:12 AM, Yijing Wang wrote: > > 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. > > > > Signed-off-by: Yijing Wang > > Well, do we really want to change all these files to not take care of a return > value ? What about is we have to check it again later ? > > I would recommend to investigate __clocksource_register_scale and the > underneath functions if there is not an error to be returned in the call stack > somewhere which is ignored today. > > The same applies for clocksource_register. There is really no point in making it fail. It's so low level that anything more than a proper printk/BUG/WARN is overkill. Thanks, tglx -- Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] [PATCH 2/2] clocksource: Make clocksource register functions void
On 2014/2/6 4:40, Thomas Gleixner wrote: > Yijing, > > On Thu, 23 Jan 2014, David Laight wrote: > >> From: Linuxppc-dev Tony Prisk >>> On 23/01/14 20:12, Yijing Wang wrote: 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. >>> .. -static inline int clocksource_register_hz(struct clocksource *cs, u32 hz) +static inline void clocksource_register_hz(struct clocksource *cs, u32 hz) { return __clocksource_register_scale(cs, 1, hz); } >>> >>> 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. > > Can you please resend with that fixed against 3.14-rc1 ? OK, I will resend later. Thanks! Yijing. > > . > -- Thanks! Yijing -- Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel