From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tony Prisk Subject: Re: [PATCH 2/2] clocksource: Make clocksource register functions void Date: Thu, 23 Jan 2014 20:45:13 +1300 Message-ID: <52E0C889.6000106@prisktech.co.nz> References: <1390461166-36440-1-git-send-email-wangyijing@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1390461166-36440-1-git-send-email-wangyijing@huawei.com> Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-subscribe: List-owner: List-post: List-archive: To: Yijing Wang , John Stultz , Thomas Gleixner Cc: Sekhar Nori , Kevin Hilman , Russell King , David Brown , Daniel Walker , Bryan Huntsman , Tony Lindgren , Haavard Skinnemoen , Hans-Christian Egtvedt , Mike Frysinger , Michal Simek , Ralf Baechle , Jonas Bonn , Benjamin Herrenschmidt , Paul Mackerras , Jeff Dike , Richard Weinberger , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Daniel Lezcano List-Id: linux-arm-msm@vger.kernel.org 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 23 Jan 2014 08:44:59 +0100 (CET) Received: from server.prisktech.co.nz ([115.188.14.127]:55267 "EHLO server.prisktech.co.nz" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S6825733AbaAWHo4t723Z (ORCPT ); Thu, 23 Jan 2014 08:44:56 +0100 Received: from [192.168.0.102] (unknown [192.168.0.102]) by server.prisktech.co.nz (Postfix) with ESMTP id 9B456FC11D3; Thu, 23 Jan 2014 20:44:56 +1300 (NZDT) Message-ID: <52E0C889.6000106@prisktech.co.nz> Date: Thu, 23 Jan 2014 20:45:13 +1300 From: Tony Prisk User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Yijing Wang , John Stultz , Thomas Gleixner CC: Sekhar Nori , Kevin Hilman , Russell King , David Brown , Daniel Walker , Bryan Huntsman , Tony Lindgren , Haavard Skinnemoen , Hans-Christian Egtvedt , Mike Frysinger , Michal Simek , Ralf Baechle , Jonas Bonn , Benjamin Herrenschmidt , Paul Mackerras , Jeff Dike , Richard Weinberger , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Daniel Lezcano , Kukjin Kim , Jim Cromie , Nicolas Ferre , Barry Song , davinci-linux-open-source@linux.davincidsp.com, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-omap@vger.kernel.org, uclinux-dist-devel@blackfin.uclinux.org, microblaze-uclinux@itee.uq.edu.au, linux-mips@linux-mips.org, linux@lists.openrisc.net, linuxppc-dev@lists.ozlabs.org, user-mode-linux-devel@lists.sourceforge.net, user-mode-linux-user@lists.sourceforge.net, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Hanjun Guo 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 Content-Transfer-Encoding: 7bit Return-Path: X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) X-Orcpt: rfc822;linux-mips@linux-mips.org Original-Recipient: rfc822;linux-mips@linux-mips.org X-archive-position: 39080 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: linux@prisktech.co.nz Precedence: bulk List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: linux-mips X-List-ID: linux-mips List-subscribe: List-owner: List-post: List-archive: X-list: linux-mips 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <52E0C889.6000106@prisktech.co.nz> Date: Thu, 23 Jan 2014 20:45:13 +1300 From: Tony Prisk MIME-Version: 1.0 References: <1390461166-36440-1-git-send-email-wangyijing@huawei.com> In-Reply-To: <1390461166-36440-1-git-send-email-wangyijing@huawei.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+geert=linux-m68k.org@lists.infradead.org Subject: Re: [PATCH 2/2] clocksource: Make clocksource register functions void To: Yijing Wang , John Stultz , Thomas Gleixner Cc: linux-mips@linux-mips.org, Daniel Lezcano , Kevin Hilman , Benjamin Herrenschmidt , 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: 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: linux@prisktech.co.nz (Tony Prisk) Date: Thu, 23 Jan 2014 20:45:13 +1300 Subject: [PATCH 2/2] clocksource: Make clocksource register functions void In-Reply-To: <1390461166-36440-1-git-send-email-wangyijing@huawei.com> References: <1390461166-36440-1-git-send-email-wangyijing@huawei.com> Message-ID: <52E0C889.6000106@prisktech.co.nz> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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