Skip to content

Commit 2b776b5

Browse files
committed
Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer fixes from Thomas Gleixner: "A small set of fixes for time(keeping): - Add a missing include to prevent compiler warnings. - Make the VDSO implementation of clock_getres() POSIX compliant again. A recent change dropped the NULL pointer guard which is required as NULL is a valid pointer value for this function. - Fix two function documentation typos" * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: posix-cpu-timers: Fix two trivial comments timers/sched_clock: Include local timekeeping.h for missing declarations lib/vdso: Make clock_getres() POSIX compliant again
2 parents a8a31fd + 7f2cbcb commit 2b776b5

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

kernel/time/posix-cpu-timers.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ static void update_gt_cputime(struct task_cputime_atomic *cputime_atomic,
266266
/**
267267
* thread_group_sample_cputime - Sample cputime for a given task
268268
* @tsk: Task for which cputime needs to be started
269-
* @iimes: Storage for time samples
269+
* @samples: Storage for time samples
270270
*
271271
* Called from sys_getitimer() to calculate the expiry time of an active
272272
* timer. That means group cputime accounting is already active. Called
@@ -1038,12 +1038,12 @@ static void posix_cpu_timer_rearm(struct k_itimer *timer)
10381038
* member of @pct->bases[CLK].nextevt. False otherwise
10391039
*/
10401040
static inline bool
1041-
task_cputimers_expired(const u64 *sample, struct posix_cputimers *pct)
1041+
task_cputimers_expired(const u64 *samples, struct posix_cputimers *pct)
10421042
{
10431043
int i;
10441044

10451045
for (i = 0; i < CPUCLOCK_MAX; i++) {
1046-
if (sample[i] >= pct->bases[i].nextevt)
1046+
if (samples[i] >= pct->bases[i].nextevt)
10471047
return true;
10481048
}
10491049
return false;

kernel/time/sched_clock.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include <linux/seqlock.h>
1818
#include <linux/bitops.h>
1919

20+
#include "timekeeping.h"
21+
2022
/**
2123
* struct clock_read_data - data required to read from sched_clock()
2224
*

lib/vdso/gettimeofday.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,10 @@ int __cvdso_clock_getres_common(clockid_t clock, struct __kernel_timespec *res)
214214
return -1;
215215
}
216216

217-
res->tv_sec = 0;
218-
res->tv_nsec = ns;
219-
217+
if (likely(res)) {
218+
res->tv_sec = 0;
219+
res->tv_nsec = ns;
220+
}
220221
return 0;
221222
}
222223

@@ -245,7 +246,7 @@ __cvdso_clock_getres_time32(clockid_t clock, struct old_timespec32 *res)
245246
ret = clock_getres_fallback(clock, &ts);
246247
#endif
247248

248-
if (likely(!ret)) {
249+
if (likely(!ret && res)) {
249250
res->tv_sec = ts.tv_sec;
250251
res->tv_nsec = ts.tv_nsec;
251252
}

0 commit comments

Comments
 (0)