From: anish kumar <anish198519851985@gmail.com>
To: john.stultz@linaro.org, tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] [Timer][Trivial] __clocksource_register_scale return value use?
Date: Thu, 07 Mar 2013 16:41:18 +0530 [thread overview]
Message-ID: <1362654678.6034.2.camel@anish-Inspiron-N5050> (raw)
__clocksource_register_scale() currently returns int but it should
return void as there are no error paths in that function.
Making it void would help some amount of code to be removed at various
places.
clocksource_register_hz/khz() return value is checked
in most of the places but I think it will translate to always
if(true) so let's remove those checks as well(patch will be sent
later for that).
Is this return value for some future usecase(?), if yes then my
apologies.
Signed-off-by: anish kumar <anish198519851985@gmail.com>
---
include/linux/clocksource.h | 6 +++---
kernel/time/clocksource.c | 7 +------
2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 27cfda4..2b074cc 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -294,17 +294,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);
}
-static inline int clocksource_register_khz(struct clocksource *cs, u32
khz)
+static inline void clocksource_register_khz(struct clocksource *cs, u32
khz)
{
return __clocksource_register_scale(cs, 1000, khz);
}
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index c958338..1915550 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -703,14 +703,11 @@ EXPORT_SYMBOL_GPL(__clocksource_updatefreq_scale);
* @scale: Scale factor multiplied against freq to get clocksource hz
* @freq: clocksource frequency (cycles per second) divided by scale
*
- * Returns -EBUSY if registration fails, zero otherwise.
- *
* This *SHOULD NOT* be called directly! Please use the
* clocksource_register_hz() or clocksource_register_khz helper
functions.
*/
-int __clocksource_register_scale(struct clocksource *cs, u32 scale, u32
freq)
+void __clocksource_register_scale(struct clocksource *cs, u32 scale,
u32 freq)
{
-
/* Initialize mult/shift and max_idle_ns */
__clocksource_updatefreq_scale(cs, scale, freq);
@@ -720,11 +717,9 @@ int __clocksource_register_scale(struct clocksource
*cs, u32 scale, u32 freq)
clocksource_enqueue_watchdog(cs);
clocksource_select();
mutex_unlock(&clocksource_mutex);
- return 0;
}
EXPORT_SYMBOL_GPL(__clocksource_register_scale);
-
/**
* clocksource_register - Used to install new clocksources
* @cs: clocksource to be registered
--
1.7.1
next reply other threads:[~2013-03-07 11:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-07 11:11 anish kumar [this message]
2013-03-09 6:03 ` anish singh
2013-03-11 5:01 ` anish singh
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=1362654678.6034.2.camel@anish-Inspiron-N5050 \
--to=anish198519851985@gmail.com \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®