From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from server.prisktech.co.nz (server.prisktech.co.nz [115.188.14.127]) by ozlabs.org (Postfix) with ESMTP id A3B852C00A8 for ; Thu, 23 Jan 2014 18:54:36 +1100 (EST) Message-ID: <52E0C889.6000106@prisktech.co.nz> Date: Thu, 23 Jan 2014 20:45:13 +1300 From: Tony Prisk MIME-Version: 1.0 To: Yijing Wang , John Stultz , Thomas Gleixner Subject: Re: [PATCH 2/2] clocksource: Make clocksource register functions void References: <1390461166-36440-1-git-send-email-wangyijing@huawei.com> In-Reply-To: <1390461166-36440-1-git-send-email-wangyijing@huawei.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Cc: linux-mips@linux-mips.org, Daniel Lezcano , Kevin Hilman , linux@lists.openrisc.net, Sekhar Nori , Paul Mackerras , "H. Peter Anvin" , Daniel Walker , Hans-Christian Egtvedt , Jonas Bonn , Kukjin Kim , Russell King , Richard Weinberger , x86@kernel.org, Tony Lindgren , Ingo Molnar , linux-arm-msm@vger.kernel.org, David Brown , Haavard Skinnemoen , Mike Frysinger , user-mode-linux-devel@lists.sourceforge.net, Nicolas Ferre , Jeff Dike , Barry Song , linux-samsung-soc@vger.kernel.org, user-mode-linux-user@lists.sourceforge.net, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, davinci-linux-open-source@linux.davincidsp.com, Michal Simek , Jim Cromie , microblaze-uclinux@itee.uq.edu.au, Hanjun Guo , linux-kernel@vger.kernel.org, Ralf Baechle , Bryan Huntsman , uclinux-dist-devel@blackfin.uclinux.org, linuxppc-dev@lists.ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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. > > Signed-off-by: Yijing Wang ...... > diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h > index 67301a4..5a17c5e 100644 > --- a/include/linux/clocksource.h > +++ b/include/linux/clocksource.h > @@ -282,7 +282,7 @@ static inline s64 clocksource_cyc2ns(cycle_t cycles, u32 mult, u32 shift) > } > > > -extern int clocksource_register(struct clocksource*); > +extern void clocksource_register(struct clocksource *); > extern int clocksource_unregister(struct clocksource*); > extern void clocksource_touch_watchdog(void); > extern struct clocksource* clocksource_get_next(void); > @@ -301,17 +301,17 @@ clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec); > * Don't call __clocksource_register_scale directly, use > * clocksource_register_hz/khz > */ > -extern int > +extern void > __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq); > extern void > __clocksource_updatefreq_scale(struct clocksource *cs, u32 scale, u32 freq); > > -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?? Regards Tony Prisk