diff options
author | Milton Miller <miltonm@bga.com> | 2007-12-13 23:52:19 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-12-20 00:15:43 -0500 |
commit | db3801a858e97adee0f3b4c732e6ff325d95e0a5 (patch) | |
tree | 77e4cdeca573b95591eecc83a2af6ac03d7c1e50 /arch | |
parent | 6e6b44e8223a01d35fceec3631be356fbdbcf004 (diff) |
[POWERPC] Depend on ->initialized in calc_steal_time
If CPU_FTR_PURR is not set, we will never set cpu_purr_data->initialized.
Checking via __get_cpu_var on 64 bit avoids one dependent load compared
to cpu_has_feature in the not-present case, and is always required when
it is present. The code is under CONFIG_VIRT_CPU_ACCOUNTING so 32 bit
will not be affected.
Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/time.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 5cf394080590..398cd0c7b60f 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c | |||
@@ -329,11 +329,9 @@ void calculate_steal_time(void) | |||
329 | s64 stolen; | 329 | s64 stolen; |
330 | struct cpu_purr_data *pme; | 330 | struct cpu_purr_data *pme; |
331 | 331 | ||
332 | if (!cpu_has_feature(CPU_FTR_PURR)) | ||
333 | return; | ||
334 | pme = &__get_cpu_var(cpu_purr_data); | 332 | pme = &__get_cpu_var(cpu_purr_data); |
335 | if (!pme->initialized) | 333 | if (!pme->initialized) |
336 | return; /* this can happen in early boot */ | 334 | return; /* !CPU_FTR_PURR or early in early boot */ |
337 | tb = mftb(); | 335 | tb = mftb(); |
338 | purr = mfspr(SPRN_PURR); | 336 | purr = mfspr(SPRN_PURR); |
339 | stolen = (tb - pme->tb) - (purr - pme->purr); | 337 | stolen = (tb - pme->tb) - (purr - pme->purr); |