Skip to content

Commit

Permalink
powerpc/setup: cleanup ifdef mess in check_cache_coherency()
Browse files Browse the repository at this point in the history
Use IS_ENABLED() instead of #ifdefs

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Christophe Leroy authored and Michael Ellerman committed May 2, 2019
1 parent e9e9b25 commit b5064ef
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions arch/powerpc/kernel/setup-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -737,23 +737,19 @@ void __init setup_panic(void)
* BUG() in that case.
*/

#ifdef CONFIG_NOT_COHERENT_CACHE
#define KERNEL_COHERENCY 0
#else
#define KERNEL_COHERENCY 1
#endif
#define KERNEL_COHERENCY (!IS_ENABLED(CONFIG_NOT_COHERENT_CACHE))

static int __init check_cache_coherency(void)
{
struct device_node *np;
const void *prop;
int devtree_coherency;
bool devtree_coherency;

np = of_find_node_by_path("/");
prop = of_get_property(np, "coherency-off", NULL);
of_node_put(np);

devtree_coherency = prop ? 0 : 1;
devtree_coherency = prop ? false : true;

if (devtree_coherency != KERNEL_COHERENCY) {
printk(KERN_ERR
Expand Down

0 comments on commit b5064ef

Please sign in to comment.