From: Tony Prisk <linux@prisktech.co.nz>
To: Yijing Wang <wangyijing@huawei.com>,
John Stultz <john.stultz@linaro.org>,
Thomas Gleixner <tglx@linutronix.de>
Cc: Sekhar Nori <nsekhar@ti.com>,
Kevin Hilman <khilman@deeprootsystems.com>,
Russell King <linux@arm.linux.org.uk>,
David Brown <davidb@codeaurora.org>,
Daniel Walker <dwalker@fifo99.com>,
Bryan Huntsman <bryanh@codeaurora.org>,
Tony Lindgren <tony@atomide.com>,
Haavard Skinnemoen <hskinnemoen@gmail.com>,
Hans-Christian Egtvedt <egtvedt@samfundet.no>,
Mike Frysinger <vapier@gentoo.org>,
Michal Simek <monstr@monstr.eu>,
Ralf Baechle <ralf@linux-mips.org>,
Jonas Bonn <jonas@southpole.se>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>, Jeff Dike <jdike@addtoit.com>,
Richard Weinberger <richard@nod.at>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, Daniel Lezcano <dan>
Subject: Re: [PATCH 2/2] clocksource: Make clocksource register functions void
Date: Thu, 23 Jan 2014 20:45:13 +1300 [thread overview]
Message-ID: <52E0C889.6000106@prisktech.co.nz> (raw)
In-Reply-To: <1390461166-36440-1-git-send-email-wangyijing@huawei.com>
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 <wangyijing@huawei.com>
......
> 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
WARNING: multiple messages have this Message-ID (diff)
From: Tony Prisk <linux@prisktech.co.nz>
To: Yijing Wang <wangyijing@huawei.com>,
John Stultz <john.stultz@linaro.org>,
Thomas Gleixner <tglx@linutronix.de>
Cc: Sekhar Nori <nsekhar@ti.com>,
Kevin Hilman <khilman@deeprootsystems.com>,
Russell King <linux@arm.linux.org.uk>,
David Brown <davidb@codeaurora.org>,
Daniel Walker <dwalker@fifo99.com>,
Bryan Huntsman <bryanh@codeaurora.org>,
Tony Lindgren <tony@atomide.com>,
Haavard Skinnemoen <hskinnemoen@gmail.com>,
Hans-Christian Egtvedt <egtvedt@samfundet.no>,
Mike Frysinger <vapier@gentoo.org>,
Michal Simek <monstr@monstr.eu>,
Ralf Baechle <ralf@linux-mips.org>,
Jonas Bonn <jonas@southpole.se>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>, Jeff Dike <jdike@addtoit.com>,
Richard Weinberger <richard@nod.at>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, Daniel Lezcano <daniel.lezcano@linaro.org>,
Kukjin Kim <kgene.kim@samsung.com>,
Jim Cromie <jim.cromie@gmail.com>,
Nicolas Ferre <nicolas.ferre@atmel.com>,
Barry Song <baohua@kernel.org>,
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 <guohanjun@huawei.com>
Subject: Re: [PATCH 2/2] clocksource: Make clocksource register functions void
Date: Thu, 23 Jan 2014 20:45:13 +1300 [thread overview]
Message-ID: <52E0C889.6000106@prisktech.co.nz> (raw)
In-Reply-To: <1390461166-36440-1-git-send-email-wangyijing@huawei.com>
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 <wangyijing@huawei.com>
......
> 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
WARNING: multiple messages have this Message-ID (diff)
From: Tony Prisk <linux@prisktech.co.nz>
To: Yijing Wang <wangyijing@huawei.com>,
John Stultz <john.stultz@linaro.org>,
Thomas Gleixner <tglx@linutronix.de>
Cc: linux-mips@linux-mips.org,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Kevin Hilman <khilman@deeprootsystems.com>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
linux@lists.openrisc.net, Sekhar Nori <nsekhar@ti.com>,
Paul Mackerras <paulus@samba.org>,
"H. Peter Anvin" <hpa@zytor.com>,
Daniel Walker <dwalker@fifo99.com>,
Hans-Christian Egtvedt <egtvedt@samfundet.no>,
Jonas Bonn <jonas@southpole.se>,
Kukjin Kim <kgene.kim@samsung.com>,
Russell King <linux@arm.linux.org.uk>,
Richard Weinberger <richard@nod.at>,
x86@kernel.org, Tony Lindgren <tony@atomide.com>,
Ingo Molnar <mingo@redhat.com>,
linux-arm-msm@vger.kernel.org,
David Brown <davidb@codeaurora.org>,
Haavard Skinnemoen <hskinnemoen@gmail.com>,
Mike Frysinger <vapier@gentoo.org>,
user-mode-linux-devel@lists.sourceforge.net,
Nicolas Ferre <nicolas.ferre@atmel.com>,
Jeff Dike <jdike@addtoit.com>, Barry Song <baohua@kernel.org>,
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 <monstr@monstr.eu>,
Jim Cromie <jim.cromie@gmail.com>,
microblaze-uclinux@itee.uq.edu.au,
Hanjun Guo <guohanjun@huawei.com>,
linux-kernel@vger.kernel.org, Ralf Baechle <ralf@linux-mips.org>,
Bryan Huntsman <bryanh@codeaurora.org>,
uclinux-dist-devel@blackfin.uclinux.org,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 2/2] clocksource: Make clocksource register functions void
Date: Thu, 23 Jan 2014 20:45:13 +1300 [thread overview]
Message-ID: <52E0C889.6000106@prisktech.co.nz> (raw)
In-Reply-To: <1390461166-36440-1-git-send-email-wangyijing@huawei.com>
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 <wangyijing@huawei.com>
......
> 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
WARNING: multiple messages have this Message-ID (diff)
From: Tony Prisk <linux@prisktech.co.nz>
To: Yijing Wang <wangyijing@huawei.com>,
John Stultz <john.stultz@linaro.org>,
Thomas Gleixner <tglx@linutronix.de>
Cc: linux-mips@linux-mips.org,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Kevin Hilman <khilman@deeprootsystems.com>,
linux@lists.openrisc.net, Sekhar Nori <nsekhar@ti.com>,
Paul Mackerras <paulus@samba.org>,
"H. Peter Anvin" <hpa@zytor.com>,
Daniel Walker <dwalker@fifo99.com>,
Hans-Christian Egtvedt <egtvedt@samfundet.no>,
Jonas Bonn <jonas@southpole.se>,
Kukjin Kim <kgene.kim@samsung.com>,
Russell King <linux@arm.linux.org.uk>,
Richard Weinberger <richard@nod.at>,
x86@kernel.org, Tony Lindgren <tony@atomide.com>,
Ingo Molnar <mingo@redhat.com>,
linux-arm-msm@vger.kernel.org,
David Brown <davidb@codeaurora.org>,
Haavard Skinnemoen <hskinnemoen@gmail.com>,
Mike Frysinger <vapier@gentoo.org>,
user-mode-linux-devel@lists.sourceforge.net,
Nicolas Ferre <nicolas.ferre@atmel.com>,
Jeff Dike <jdike@addtoit.com>, Barry Song <baohua@kernel.org>,
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 <monstr@monstr.eu>,
Jim Cromie <jim.cromie@gmail.com>,
microblaze-uclinux@itee.uq.edu.au,
Hanjun Guo <guohanjun@huawei.com>,
linux-kernel@vger.kernel.org, Ralf Baechle <ralf@linux-mips.org>,
Bryan Huntsman <bryanh@codeaurora.org>,
uclinux-dist-devel@blackfin.uclinux.org,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 2/2] clocksource: Make clocksource register functions void
Date: Thu, 23 Jan 2014 20:45:13 +1300 [thread overview]
Message-ID: <52E0C889.6000106@prisktech.co.nz> (raw)
In-Reply-To: <1390461166-36440-1-git-send-email-wangyijing@huawei.com>
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 <wangyijing@huawei.com>
......
> 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
WARNING: multiple messages have this Message-ID (diff)
From: linux@prisktech.co.nz (Tony Prisk)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] clocksource: Make clocksource register functions void
Date: Thu, 23 Jan 2014 20:45:13 +1300 [thread overview]
Message-ID: <52E0C889.6000106@prisktech.co.nz> (raw)
In-Reply-To: <1390461166-36440-1-git-send-email-wangyijing@huawei.com>
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 <wangyijing@huawei.com>
......
> 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
next prev parent reply other threads:[~2014-01-23 7:45 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-23 7:12 [PATCH 2/2] clocksource: Make clocksource register functions void Yijing Wang
2014-01-23 7:12 ` Yijing Wang
2014-01-23 7:12 ` Yijing Wang
2014-01-23 7:12 ` Yijing Wang
2014-01-23 7:12 ` Yijing Wang
2014-01-23 7:12 ` Yijing Wang
2014-01-23 7:40 ` Hans-Christian Egtvedt
2014-01-23 7:40 ` Hans-Christian Egtvedt
2014-01-23 7:40 ` Hans-Christian Egtvedt
2014-01-23 7:40 ` Hans-Christian Egtvedt
2014-01-23 7:40 ` Hans-Christian Egtvedt
2014-01-23 7:45 ` Tony Prisk [this message]
2014-01-23 7:45 ` Tony Prisk
2014-01-23 7:45 ` Tony Prisk
2014-01-23 7:45 ` Tony Prisk
2014-01-23 7:45 ` Tony Prisk
2014-01-23 7:58 ` Geert Uytterhoeven
2014-01-23 7:58 ` Geert Uytterhoeven
2014-01-23 7:58 ` Geert Uytterhoeven
2014-01-23 7:58 ` Geert Uytterhoeven
2014-01-23 8:04 ` Tony Prisk
2014-01-23 8:04 ` Tony Prisk
2014-01-23 8:04 ` Tony Prisk
2014-01-23 8:04 ` Tony Prisk
2014-01-23 8:17 ` Yijing Wang
2014-01-23 8:17 ` Yijing Wang
2014-01-23 8:17 ` Yijing Wang
2014-01-23 8:17 ` Yijing Wang
2014-01-23 8:17 ` Yijing Wang
2014-01-23 11:40 ` David Laight
2014-01-23 11:40 ` David Laight
2014-01-23 11:40 ` David Laight
2014-01-23 11:40 ` David Laight
2014-01-23 11:40 ` David Laight
2014-02-05 20:40 ` Thomas Gleixner
2014-02-05 20:40 ` Thomas Gleixner
2014-02-05 20:40 ` Thomas Gleixner
2014-02-05 20:40 ` Thomas Gleixner
2014-02-05 20:40 ` Thomas Gleixner
2014-02-10 1:13 ` Yijing Wang
2014-02-10 1:13 ` Yijing Wang
2014-02-10 1:13 ` Yijing Wang
2014-02-10 1:13 ` Yijing Wang
2014-02-10 1:13 ` Yijing Wang
2014-01-23 8:40 ` Daniel Lezcano
2014-01-23 8:40 ` Daniel Lezcano
2014-01-23 8:40 ` Daniel Lezcano
2014-01-23 8:40 ` Daniel Lezcano
2014-01-23 8:40 ` Daniel Lezcano
[not found] ` <52E0D575.5050702-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-01-23 9:01 ` Yijing Wang
2014-01-23 9:01 ` Yijing Wang
2014-01-23 9:01 ` Yijing Wang
2014-01-23 9:01 ` Yijing Wang
2014-01-23 9:01 ` Yijing Wang
2014-01-23 9:01 ` Yijing Wang
2014-02-05 20:39 ` Thomas Gleixner
2014-02-05 20:39 ` Thomas Gleixner
2014-02-05 20:39 ` Thomas Gleixner
2014-02-05 20:39 ` Thomas Gleixner
2014-02-05 20:39 ` Thomas Gleixner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52E0C889.6000106@prisktech.co.nz \
--to=linux@prisktech.co.nz \
--cc=benh@kernel.crashing.org \
--cc=bryanh@codeaurora.org \
--cc=davidb@codeaurora.org \
--cc=dwalker@fifo99.com \
--cc=egtvedt@samfundet.no \
--cc=hpa@zytor.com \
--cc=hskinnemoen@gmail.com \
--cc=jdike@addtoit.com \
--cc=john.stultz@linaro.org \
--cc=jonas@southpole.se \
--cc=khilman@deeprootsystems.com \
--cc=linux@arm.linux.org.uk \
--cc=mingo@redhat.com \
--cc=monstr@monstr.eu \
--cc=nsekhar@ti.com \
--cc=paulus@samba.org \
--cc=ralf@linux-mips.org \
--cc=richard@nod.at \
--cc=tglx@linutronix.de \
--cc=tony@atomide.com \
--cc=vapier@gentoo.org \
--cc=wangyijing@huawei.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.