Skip to content

Commit 46dae32

Browse files
Youngmin NamKAGA-KOKO
authored andcommitted
time: Correct the prototype of ns_to_kernel_old_timeval and ns_to_timespec64
In ns_to_kernel_old_timeval() definition, the function argument is defined with const identifier in kernel/time/time.c, but the prototype in include/linux/time32.h looks different. - The function is defined in kernel/time/time.c as below: struct __kernel_old_timeval ns_to_kernel_old_timeval(const s64 nsec) - The function is decalared in include/linux/time32.h as below: extern struct __kernel_old_timeval ns_to_kernel_old_timeval(s64 nsec); Because the variable of arithmethic types isn't modified in the calling scope, there's no need to mark arguments as const, which was already mentioned during review (Link[1) of the original patch. Likewise remove the "const" keyword in both definition and declaration of ns_to_timespec64() as requested by Arnd (Link[2]). Fixes: a84d116 ("y2038: Introduce struct __kernel_old_timeval") Signed-off-by: Youngmin Nam <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/all/[email protected] Link[1]: https://lore.kernel.org/all/[email protected]/ Link[2]: https://lore.kernel.org/all/CAK8P3a3nknJgEDESGdJH91jMj6R_xydFqWASd8r5BbesdvMBgA@mail.gmail.com/
1 parent 221f9d9 commit 46dae32

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/linux/time64.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static inline s64 timespec64_to_ns(const struct timespec64 *ts)
145145
*
146146
* Returns the timespec64 representation of the nsec parameter.
147147
*/
148-
extern struct timespec64 ns_to_timespec64(const s64 nsec);
148+
extern struct timespec64 ns_to_timespec64(s64 nsec);
149149

150150
/**
151151
* timespec64_add_ns - Adds nanoseconds to a timespec64

kernel/time/time.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ time64_t mktime64(const unsigned int year0, const unsigned int mon0,
449449
}
450450
EXPORT_SYMBOL(mktime64);
451451

452-
struct __kernel_old_timeval ns_to_kernel_old_timeval(const s64 nsec)
452+
struct __kernel_old_timeval ns_to_kernel_old_timeval(s64 nsec)
453453
{
454454
struct timespec64 ts = ns_to_timespec64(nsec);
455455
struct __kernel_old_timeval tv;
@@ -503,7 +503,7 @@ EXPORT_SYMBOL(set_normalized_timespec64);
503503
*
504504
* Returns the timespec64 representation of the nsec parameter.
505505
*/
506-
struct timespec64 ns_to_timespec64(const s64 nsec)
506+
struct timespec64 ns_to_timespec64(s64 nsec)
507507
{
508508
struct timespec64 ts = { 0, 0 };
509509
s32 rem;

0 commit comments

Comments
 (0)