OSDN Git Service

powerpc/process: Remove useless #ifdef CONFIG_SPE
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Mon, 17 Aug 2020 05:47:57 +0000 (05:47 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 15 Sep 2020 12:13:36 +0000 (22:13 +1000)
commit532ed1900d37a47c821718a0d8d28eb05b2c4d28
treee1911c54b1cb8ed539dd722a9bbeb3db2aded7f1
parente3667ee427e224f9951eb3940a97477285548134
powerpc/process: Remove useless #ifdef CONFIG_SPE

cpu_has_feature(CPU_FTR_SPE) returns false when CONFIG_SPE is
not set.

There is no need to enclose the test in an #ifdef CONFIG_SPE.
Remove it.

CPU_FTR_SPE only exists on 32 bits. Define it as 0 on 64 bits.

We have a couple of places like:

 #ifdef CONFIG_SPE
if (cpu_has_feature(CPU_FTR_SPE)) {
do_something_that_requires_CONFIG_SPE
} else {
return -EINVAL;
}
 #else
return -EINVAL;
 #endif

Replace them by a cleaner version:

if (cpu_has_feature(CPU_FTR_SPE)) {
 #ifdef CONFIG_SPE
do_something_that_requires_CONFIG_SPE
 #endif
} else {
return -EINVAL;
}

When CONFIG_SPE is not set, this resolves to an unconditional
return of -EINVAL

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/698df8387555765b70ea42e4a7fa48141c309c1f.1597643221.git.christophe.leroy@csgroup.eu
arch/powerpc/include/asm/cputable.h
arch/powerpc/kernel/process.c