diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2014-07-16 21:04:38 +0000 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2014-07-23 10:18:07 -0700 |
commit | f2dec1eae8029bb056a3c1b2d3373681fa8e3e7a (patch) | |
tree | d3f8daca72af614d8d9e8e5c8b5e4a07adb8c6c0 /arch/powerpc/platforms/cell/spu_base.c | |
parent | 68f6783d28316affcd2ce332d949e40e4c7416bd (diff) | |
download | linux-f2dec1eae8029bb056a3c1b2d3373681fa8e3e7a.tar.gz linux-f2dec1eae8029bb056a3c1b2d3373681fa8e3e7a.tar.bz2 linux-f2dec1eae8029bb056a3c1b2d3373681fa8e3e7a.zip |
powerpc: cell: Use ktime_get_ns()
Replace the ever recurring:
ts = ktime_get_ts();
ns = timespec_to_ns(&ts);
with
ns = ktime_get_ns();
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'arch/powerpc/platforms/cell/spu_base.c')
-rw-r--r-- | arch/powerpc/platforms/cell/spu_base.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c index f85db3a69b4a..2930d1e81a05 100644 --- a/arch/powerpc/platforms/cell/spu_base.c +++ b/arch/powerpc/platforms/cell/spu_base.c @@ -611,7 +611,6 @@ static int __init create_spu(void *data) int ret; static int number; unsigned long flags; - struct timespec ts; ret = -ENOMEM; spu = kzalloc(sizeof (*spu), GFP_KERNEL); @@ -652,8 +651,7 @@ static int __init create_spu(void *data) mutex_unlock(&spu_full_list_mutex); spu->stats.util_state = SPU_UTIL_IDLE_LOADED; - ktime_get_ts(&ts); - spu->stats.tstamp = timespec_to_ns(&ts); + spu->stats.tstamp = ktime_get_ns(); INIT_LIST_HEAD(&spu->aff_list); @@ -676,7 +674,6 @@ static const char *spu_state_names[] = { static unsigned long long spu_acct_time(struct spu *spu, enum spu_utilization_state state) { - struct timespec ts; unsigned long long time = spu->stats.times[state]; /* @@ -684,10 +681,8 @@ static unsigned long long spu_acct_time(struct spu *spu, * statistics are not updated. Apply the time delta from the * last recorded state of the spu. */ - if (spu->stats.util_state == state) { - ktime_get_ts(&ts); - time += timespec_to_ns(&ts) - spu->stats.tstamp; - } + if (spu->stats.util_state == state) + time += ktime_get_ns() - spu->stats.tstamp; return time / NSEC_PER_MSEC; } |