Skip to contentSkip to conversation

clocksource: fix some comments typo in clocksource.c

PATCH In review Yijing Wang 2 participants 3 messages Jan 2, 2014 – Jan 23, 2014 Timekeeping, clocksource core, NTP, alarmtimer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clocksource: fix some comments typo in clocksource.c

Fix some trivial comments typo in kernel/time/clocksource.c

---
 kernel/time/clocksource.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
kernel/time/clocksource.c +0 -3
index ba3e502..9951575 100644
@@ -779,8 +779,6 @@ 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.
  */
@@ -805,7 +803,6 @@ EXPORT_SYMBOL_GPL(__clocksource_register_scale);
  * clocksource_register - Used to install new clocksources
  * @cs:		clocksource to be registered
  *
- * Returns -EBUSY if registration fails, zero otherwise.
  */
 int clocksource_register(struct clocksource *cs)
 {
Signature · 1 line
1.7.1
#1 lore raw
Quoted 1 line · Yijing Wang

Fix some trivial comments typo in kernel/time/clocksource.c

That's not a typo. Thats a left over. The function simply cannot fail anymore. So the subject of that patch should be something like:

clocksource: Remove outdated comments

And the changelog should explain, that the functions always return 0, so the comment is just pointless. A nice follow up on that would be to actually make the function void instead of returning a pointless int, but that requires to check all call sites.

Thanks,

tglx

Quoted 31 lines
---
 kernel/time/clocksource.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
kernel/time/clocksource.c +0 -3
index ba3e502..9951575 100644
@@ -779,8 +779,6 @@ 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.
  */
@@ -805,7 +803,6 @@ EXPORT_SYMBOL_GPL(__clocksource_register_scale);
  * clocksource_register - Used to install new clocksources
  * @cs:		clocksource to be registered
  *
- * Returns -EBUSY if registration fails, zero otherwise.
  */
 int clocksource_register(struct clocksource *cs)
 {
Signature · 1 line
1.7.1
#2 lore raw
Quoted 8 lines · Thomas Gleixner
Quoted 1 line · Yijing Wang

Fix some trivial comments typo in kernel/time/clocksource.c

That's not a typo. Thats a left over. The function simply cannot fail anymore. So the subject of that patch should be something like:

clocksource: Remove outdated comments

Hi Thomas, sorry for my poor English, I will update this patch title and changelog.

Quoted 5 lines

And the changelog should explain, that the functions always return 0, so the comment is just pointless. A nice follow up on that would be to actually make the function void instead of returning a pointless int, but that requires to check all call sites.

You are right, it's pointless to return 0, I will try to change the function type to void in a separate patch, thanks!

Quoted 34 lines
Quoted 32 lines
---
 kernel/time/clocksource.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
kernel/time/clocksource.c +0 -3
index ba3e502..9951575 100644
@@ -779,8 +779,6 @@ 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.
  */
@@ -805,7 +803,6 @@ EXPORT_SYMBOL_GPL(__clocksource_register_scale);
  * clocksource_register - Used to install new clocksources
  * @cs:		clocksource to be registered
  *
- * Returns -EBUSY if registration fails, zero otherwise.
  */
 int clocksource_register(struct clocksource *cs)
 {
Signature · 1 line
1.7.1
Signature · 2 lines
Thanks!
Yijing