2020-11-13 07:26:41

by Alex Shi

[permalink] [raw]
Subject: [PATCH 1/6] time: fix kernel-doc markup

The kernel-doc interface error cause some warning:
kernel/time/timeconv.c:79: warning: Function parameter or member
'totalsecs' not described in 'time64_to_tm'
kernel/time/timeconv.c:79: warning: Function parameter or member
'offset' not described in 'time64_to_tm'
kernel/time/timeconv.c:79: warning: Function parameter or member
'result' not described in 'time64_to_tm'

Fix them.

Signed-off-by: Alex Shi <[email protected]>
Cc: John Stultz <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Stephen Boyd <[email protected]>
Cc: [email protected]
---
kernel/time/timeconv.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/time/timeconv.c b/kernel/time/timeconv.c
index 589e0a552129..62e3b46717a6 100644
--- a/kernel/time/timeconv.c
+++ b/kernel/time/timeconv.c
@@ -70,10 +70,10 @@ static const unsigned short __mon_yday[2][13] = {
/**
* time64_to_tm - converts the calendar time to local broken-down time
*
- * @totalsecs the number of seconds elapsed since 00:00:00 on January 1, 1970,
+ * @totalsecs: the number of seconds elapsed since 00:00:00 on January 1, 1970,
* Coordinated Universal Time (UTC).
- * @offset offset seconds adding to totalsecs.
- * @result pointer to struct tm variable to receive broken-down time
+ * @offset: offset seconds adding to totalsecs.
+ * @result: pointer to struct tm variable to receive broken-down time
*/
void time64_to_tm(time64_t totalsecs, int offset, struct tm *result)
{
--
2.29.GIT


2020-11-13 07:27:05

by Alex Shi

[permalink] [raw]
Subject: [PATCH 4/6] timekeeping: remove static functions from kernel-doc markup

There are couple of functions are 'static' without correct kernel-doc
marks. Since they are not likely be used by others, moving them out of
kernel-doc is better.

Signed-off-by: Alex Shi <[email protected]>
Cc: John Stultz <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Stephen Boyd <[email protected]>
Cc: [email protected]
---
kernel/time/timekeeping.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 9db6aee48c52..9bee13d94d70 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1403,7 +1403,7 @@ void timekeeping_warp_clock(void)
}
}

-/**
+/*
* __timekeeping_set_tai_offset - Sets the TAI offset from UTC and monotonic
*
*/
@@ -1413,7 +1413,7 @@ static void __timekeeping_set_tai_offset(struct timekeeper *tk, s32 tai_offset)
tk->offs_tai = ktime_add(tk->offs_real, ktime_set(tai_offset, 0));
}

-/**
+/*
* change_clocksource - Swaps clocksources if a new one is available
*
* Accumulates current time interval and initializes new clocksource
@@ -2011,7 +2011,7 @@ static void timekeeping_adjust(struct timekeeper *tk, s64 offset)
}
}

-/**
+/*
* accumulate_nsecs_to_secs - Accumulates nsecs into secs
*
* Helper function that accumulates the nsecs greater than a second
@@ -2059,7 +2059,7 @@ static inline unsigned int accumulate_nsecs_to_secs(struct timekeeper *tk)
return clock_set;
}

-/**
+/*
* logarithmic_accumulation - shifted accumulation of cycles
*
* This functions accumulates a shifted interval of cycles into
@@ -2295,7 +2295,7 @@ ktime_t ktime_get_update_offsets_now(unsigned int *cwsseq, ktime_t *offs_real,
return base;
}

-/**
+/*
* timekeeping_validate_timex - Ensures the timex is ok for use in do_adjtimex
*/
static int timekeeping_validate_timex(const struct __kernel_timex *txc)
--
2.29.GIT

2020-11-13 07:27:35

by Alex Shi

[permalink] [raw]
Subject: [PATCH 3/6] timekeeping: add kernel-doc markup for pvclock notifier

Add the missed parameter explaination for kernel-doc markup to remove
warning:
kernel/time/timekeeping.c:651: warning: Function parameter or member
'nb' not described in 'pvclock_gtod_register_notifier'
kernel/time/timekeeping.c:670: warning: Function parameter or member
'nb' not described in 'pvclock_gtod_unregister_notifier'

Signed-off-by: Alex Shi <[email protected]>
Cc: John Stultz <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Stephen Boyd <[email protected]>
Cc: [email protected]
---
kernel/time/timekeeping.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index d0f7cd1b8823..9db6aee48c52 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -648,6 +648,7 @@ static void update_pvclock_gtod(struct timekeeper *tk, bool was_set)

/**
* pvclock_gtod_register_notifier - register a pvclock timedata update listener
+ * @nb: a notifier entry which register on pvclock_gtod_chain.
*/
int pvclock_gtod_register_notifier(struct notifier_block *nb)
{
@@ -667,6 +668,7 @@ EXPORT_SYMBOL_GPL(pvclock_gtod_register_notifier);
/**
* pvclock_gtod_unregister_notifier - unregister a pvclock
* timedata update listener
+ * @nb: a notifier entry which unregister on pvclock_gtod_chain.
*/
int pvclock_gtod_unregister_notifier(struct notifier_block *nb)
{
--
2.29.GIT

2020-11-13 07:28:38

by Alex Shi

[permalink] [raw]
Subject: [PATCH 6/6] timekeeping: fix kernel-doc mark issue on read_persistent_clock64

Fix the kernel-doc markup:
kernel/time/timekeeping.c:1563: warning: Function parameter or member
'wall_time' not described in 'read_persistent_wall_and_boot_offset'
kernel/time/timekeeping.c:1563: warning: Function parameter or member
'boot_offset' not described in 'read_persistent_wall_and_boot_offset'

Signed-off-by: Alex Shi <[email protected]>
Cc: John Stultz <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Stephen Boyd <[email protected]>
Cc: [email protected]
---
kernel/time/timekeeping.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 08ab749a76fc..665e820bb883 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1556,8 +1556,9 @@ void __weak read_persistent_clock64(struct timespec64 *ts)
* from the boot.
*
* Weak dummy function for arches that do not yet support it.
- * wall_time - current time as returned by persistent clock
- * boot_offset - offset that is defined as wall_time - boot_time
+ * @wall_time: - current time as returned by persistent clock
+ * @boot_offset: - offset that is defined as wall_time - boot_time
+ *
* The default function calculates offset based on the current value of
* local_clock(). This way architectures that support sched_clock() but don't
* support dedicated boot time clock will provide the best estimate of the
--
2.29.GIT

2020-11-15 22:55:08

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [PATCH 6/6] timekeeping: fix kernel-doc mark issue on read_persistent_clock64

On Fri, Nov 13 2020 at 15:24, Alex Shi wrote:
> Fix the kernel-doc markup:
> kernel/time/timekeeping.c:1563: warning: Function parameter or member
> 'wall_time' not described in 'read_persistent_wall_and_boot_offset'
> kernel/time/timekeeping.c:1563: warning: Function parameter or member
> 'boot_offset' not described in 'read_persistent_wall_and_boot_offset'

How is the subject related to the actual problem ?

Thanks,

tglx

2020-11-15 22:58:05

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [PATCH 1/6] time: fix kernel-doc markup

On Fri, Nov 13 2020 at 15:24, Alex Shi wrote:

> The kernel-doc interface error cause some warning:

I fixes the lot up and applied it. Please look at the changes I did and
be more careful next time.

Thanks,

tglx

2020-11-15 22:58:55

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [PATCH 3/6] timekeeping: add kernel-doc markup for pvclock notifier

On Fri, Nov 13 2020 at 15:24, Alex Shi wrote:
> /**
> * pvclock_gtod_register_notifier - register a pvclock timedata update listener
> + * @nb: a notifier entry which register on pvclock_gtod_chain.

What is a notifier entry? The struct is named notifier_block and the
argument is a pointer to a notifier block. So why making things up?

Also it's completely irrelevant for the reader to know about the name of
the notifier chain. The function documentation says:

register a pvclock timedata update listener

which precisely describes what the function does. pvclock_gtod_chain is
an internal implementation detail and nothing external can depend on it.
It could be renamed to 'foo_bar' and the function would still do the
same thing.

* @nb: Notifier block to register

is precise and good enough, isn't it?

Thanks,

tglx

2020-11-15 23:00:12

by tip-bot2 for Jacob Pan

[permalink] [raw]
Subject: [tip: timers/core] time: Add missing colons for parameter documentation of time64_to_tm()

The following commit has been merged into the timers/core branch of tip:

Commit-ID: a0f5a65fa5faeef708d022698d5fcba290a35856
Gitweb: https://git.kernel.org/tip/a0f5a65fa5faeef708d022698d5fcba290a35856
Author: Alex Shi <[email protected]>
AuthorDate: Fri, 13 Nov 2020 15:24:30 +08:00
Committer: Thomas Gleixner <[email protected]>
CommitterDate: Sun, 15 Nov 2020 23:47:23 +01:00

time: Add missing colons for parameter documentation of time64_to_tm()

Address these kernel-doc warnings:

kernel/time/timeconv.c:79: warning: Function parameter or member
'totalsecs' not described in 'time64_to_tm'
kernel/time/timeconv.c:79: warning: Function parameter or member
'offset' not described in 'time64_to_tm'
kernel/time/timeconv.c:79: warning: Function parameter or member
'result' not described in 'time64_to_tm'

The parameters are described but lack colons after the parameter name.

[ tglx: Massaged changelog ]

Signed-off-by: Alex Shi <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]

---
kernel/time/timeconv.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/time/timeconv.c b/kernel/time/timeconv.c
index 589e0a5..62e3b46 100644
--- a/kernel/time/timeconv.c
+++ b/kernel/time/timeconv.c
@@ -70,10 +70,10 @@ static const unsigned short __mon_yday[2][13] = {
/**
* time64_to_tm - converts the calendar time to local broken-down time
*
- * @totalsecs the number of seconds elapsed since 00:00:00 on January 1, 1970,
+ * @totalsecs: the number of seconds elapsed since 00:00:00 on January 1, 1970,
* Coordinated Universal Time (UTC).
- * @offset offset seconds adding to totalsecs.
- * @result pointer to struct tm variable to receive broken-down time
+ * @offset: offset seconds adding to totalsecs.
+ * @result: pointer to struct tm variable to receive broken-down time
*/
void time64_to_tm(time64_t totalsecs, int offset, struct tm *result)
{

2020-11-15 23:02:46

by tip-bot2 for Jacob Pan

[permalink] [raw]
Subject: [tip: timers/core] timekeeping: Remove static functions from kernel-doc markup

The following commit has been merged into the timers/core branch of tip:

Commit-ID: 199d280c884de44c3b0daeb77438db43f6db01a2
Gitweb: https://git.kernel.org/tip/199d280c884de44c3b0daeb77438db43f6db01a2
Author: Alex Shi <[email protected]>
AuthorDate: Fri, 13 Nov 2020 15:24:33 +08:00
Committer: Thomas Gleixner <[email protected]>
CommitterDate: Sun, 15 Nov 2020 23:47:23 +01:00

timekeeping: Remove static functions from kernel-doc markup

Various static functions in the timekeeping code have function comments
which pretend to be kernel-doc, but are incomplete and trigger parser
warnings.

As these functions are local to the timekeeping core code there is no need
to expose them via kernel-doc.

Remove the double star kernel-doc marker and remove excess newlines.

[ tglx: Massaged changelog and removed excess newlines ]

Signed-off-by: Alex Shi <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]

---
kernel/time/timekeeping.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 6858a31..570fc50 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1415,9 +1415,8 @@ void timekeeping_warp_clock(void)
}
}

-/**
+/*
* __timekeeping_set_tai_offset - Sets the TAI offset from UTC and monotonic
- *
*/
static void __timekeeping_set_tai_offset(struct timekeeper *tk, s32 tai_offset)
{
@@ -1425,7 +1424,7 @@ static void __timekeeping_set_tai_offset(struct timekeeper *tk, s32 tai_offset)
tk->offs_tai = ktime_add(tk->offs_real, ktime_set(tai_offset, 0));
}

-/**
+/*
* change_clocksource - Swaps clocksources if a new one is available
*
* Accumulates current time interval and initializes new clocksource
@@ -2023,13 +2022,12 @@ static void timekeeping_adjust(struct timekeeper *tk, s64 offset)
}
}

-/**
+/*
* accumulate_nsecs_to_secs - Accumulates nsecs into secs
*
* Helper function that accumulates the nsecs greater than a second
* from the xtime_nsec field to the xtime_secs field.
* It also calls into the NTP code to handle leapsecond processing.
- *
*/
static inline unsigned int accumulate_nsecs_to_secs(struct timekeeper *tk)
{
@@ -2071,7 +2069,7 @@ static inline unsigned int accumulate_nsecs_to_secs(struct timekeeper *tk)
return clock_set;
}

-/**
+/*
* logarithmic_accumulation - shifted accumulation of cycles
*
* This functions accumulates a shifted interval of cycles into
@@ -2314,7 +2312,7 @@ ktime_t ktime_get_update_offsets_now(unsigned int *cwsseq, ktime_t *offs_real,
return base;
}

-/**
+/*
* timekeeping_validate_timex - Ensures the timex is ok for use in do_adjtimex
*/
static int timekeeping_validate_timex(const struct __kernel_timex *txc)

2020-11-16 01:11:24

by tip-bot2 for Jacob Pan

[permalink] [raw]
Subject: [tip: timers/core] timekeeping: Add missing parameter docs for pvclock_gtod_[un]register_notifier()

The following commit has been merged into the timers/core branch of tip:

Commit-ID: f27f7c3f100e74a7f451a63a15788f50c52f7cce
Gitweb: https://git.kernel.org/tip/f27f7c3f100e74a7f451a63a15788f50c52f7cce
Author: Alex Shi <[email protected]>
AuthorDate: Fri, 13 Nov 2020 15:24:32 +08:00
Committer: Thomas Gleixner <[email protected]>
CommitterDate: Sun, 15 Nov 2020 23:47:24 +01:00

timekeeping: Add missing parameter docs for pvclock_gtod_[un]register_notifier()

The kernel-doc parser complains about:
kernel/time/timekeeping.c:651: warning: Function parameter or member
'nb' not described in 'pvclock_gtod_register_notifier'
kernel/time/timekeeping.c:670: warning: Function parameter or member
'nb' not described in 'pvclock_gtod_unregister_notifier'

Add the missing parameter explanations.

[ tglx: Massaged changelog ]

Signed-off-by: Alex Shi <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]

---
kernel/time/timekeeping.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index ab4b831..9c93923 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -663,6 +663,7 @@ static void update_pvclock_gtod(struct timekeeper *tk, bool was_set)

/**
* pvclock_gtod_register_notifier - register a pvclock timedata update listener
+ * @nb: Pointer to the notifier block to register
*/
int pvclock_gtod_register_notifier(struct notifier_block *nb)
{
@@ -682,6 +683,7 @@ EXPORT_SYMBOL_GPL(pvclock_gtod_register_notifier);
/**
* pvclock_gtod_unregister_notifier - unregister a pvclock
* timedata update listener
+ * @nb: Pointer to the notifier block to unregister
*/
int pvclock_gtod_unregister_notifier(struct notifier_block *nb)
{

2020-11-16 01:13:02

by tip-bot2 for Jacob Pan

[permalink] [raw]
Subject: [tip: timers/core] timekeeping: Fix parameter docs of read_persistent_wall_and_boot_offset()

The following commit has been merged into the timers/core branch of tip:

Commit-ID: 29efc4612ac1b888e65da408b41dafa4dd00842f
Gitweb: https://git.kernel.org/tip/29efc4612ac1b888e65da408b41dafa4dd00842f
Author: Alex Shi <[email protected]>
AuthorDate: Fri, 13 Nov 2020 15:24:35 +08:00
Committer: Thomas Gleixner <[email protected]>
CommitterDate: Sun, 15 Nov 2020 23:47:24 +01:00

timekeeping: Fix parameter docs of read_persistent_wall_and_boot_offset()

Address the following kernel-doc markup warnings:

kernel/time/timekeeping.c:1563: warning: Function parameter or member
'wall_time' not described in 'read_persistent_wall_and_boot_offset'
kernel/time/timekeeping.c:1563: warning: Function parameter or member
'boot_offset' not described in 'read_persistent_wall_and_boot_offset'

The parameters are described but miss the leading '@' and the colon after
the parameter names.

[ tglx: Massaged changelog ]

Signed-off-by: Alex Shi <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]

---
kernel/time/timekeeping.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 9c93923..75cba95 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1576,8 +1576,9 @@ void __weak read_persistent_clock64(struct timespec64 *ts)
* from the boot.
*
* Weak dummy function for arches that do not yet support it.
- * wall_time - current time as returned by persistent clock
- * boot_offset - offset that is defined as wall_time - boot_time
+ * @wall_time: - current time as returned by persistent clock
+ * @boot_offset: - offset that is defined as wall_time - boot_time
+ *
* The default function calculates offset based on the current value of
* local_clock(). This way architectures that support sched_clock() but don't
* support dedicated boot time clock will provide the best estimate of the

2020-11-16 04:29:38

by Alex Shi

[permalink] [raw]
Subject: Re: [PATCH 1/6] time: fix kernel-doc markup



?? 2020/11/16 ????6:48, Thomas Gleixner ะด??:
> On Fri, Nov 13 2020 at 15:24, Alex Shi wrote:
>
>> The kernel-doc interface error cause some warning:
>
> I fixes the lot up and applied it. Please look at the changes I did and
> be more careful next time.
>

Hi Thomas,

Thanks a lot for all fix and kindly coaching! I have learned a lot here.

Thanks
Alex