Skip to content

Commit

Permalink
Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/sc…
Browse files Browse the repository at this point in the history
…m/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
  • Loading branch information
Linus Torvalds committed Oct 27, 2019
2 parents a8a31fd + 7f2cbcb commit 2b776b5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 3 additions & 3 deletions kernel/time/posix-cpu-timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ static void update_gt_cputime(struct task_cputime_atomic *cputime_atomic,
/**
* thread_group_sample_cputime - Sample cputime for a given task
* @tsk: Task for which cputime needs to be started
* @iimes: Storage for time samples
* @samples: Storage for time samples
*
* Called from sys_getitimer() to calculate the expiry time of an active
* timer. That means group cputime accounting is already active. Called
Expand Down Expand Up @@ -1038,12 +1038,12 @@ static void posix_cpu_timer_rearm(struct k_itimer *timer)
* member of @pct->bases[CLK].nextevt. False otherwise
*/
static inline bool
task_cputimers_expired(const u64 *sample, struct posix_cputimers *pct)
task_cputimers_expired(const u64 *samples, struct posix_cputimers *pct)
{
int i;

for (i = 0; i < CPUCLOCK_MAX; i++) {
if (sample[i] >= pct->bases[i].nextevt)
if (samples[i] >= pct->bases[i].nextevt)
return true;
}
return false;
Expand Down
2 changes: 2 additions & 0 deletions kernel/time/sched_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include <linux/seqlock.h>
#include <linux/bitops.h>

#include "timekeeping.h"

/**
* struct clock_read_data - data required to read from sched_clock()
*
Expand Down
9 changes: 5 additions & 4 deletions lib/vdso/gettimeofday.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,10 @@ int __cvdso_clock_getres_common(clockid_t clock, struct __kernel_timespec *res)
return -1;
}

res->tv_sec = 0;
res->tv_nsec = ns;

if (likely(res)) {
res->tv_sec = 0;
res->tv_nsec = ns;
}
return 0;
}

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

if (likely(!ret)) {
if (likely(!ret && res)) {
res->tv_sec = ts.tv_sec;
res->tv_nsec = ts.tv_nsec;
}
Expand Down

0 comments on commit 2b776b5

Please sign in to comment.