Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: a84d1169164b ("y2038: Introduce struct __kernel_old_timeval")
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/all/20220712094715.2918823-1-youngmin.nam@samsung.com
Link[1]: https://lore.kernel.org/all/20180310081123.thin6wphgk7tongy@gmail.com/
Link[2]: https://lore.kernel.org/all/CAK8P3a3nknJgEDESGdJH91jMj6R_xydFqWASd8r5BbesdvMBgA@mail.gmail.com/

authored by

Youngmin Nam and committed by
Thomas Gleixner
46dae32f 221f9d9c

+3 -3
+1 -1
include/linux/time64.h
··· 145 145 * 146 146 * Returns the timespec64 representation of the nsec parameter. 147 147 */ 148 - extern struct timespec64 ns_to_timespec64(const s64 nsec); 148 + extern struct timespec64 ns_to_timespec64(s64 nsec); 149 149 150 150 /** 151 151 * timespec64_add_ns - Adds nanoseconds to a timespec64
+2 -2
kernel/time/time.c
··· 449 449 } 450 450 EXPORT_SYMBOL(mktime64); 451 451 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) 453 453 { 454 454 struct timespec64 ts = ns_to_timespec64(nsec); 455 455 struct __kernel_old_timeval tv; ··· 503 503 * 504 504 * Returns the timespec64 representation of the nsec parameter. 505 505 */ 506 - struct timespec64 ns_to_timespec64(const s64 nsec) 506 + struct timespec64 ns_to_timespec64(s64 nsec) 507 507 { 508 508 struct timespec64 ts = { 0, 0 }; 509 509 s32 rem;