Merge patch series "Some style cleanups for recent extension additions"
[linux-block.git] / arch / riscv / errata / thead / errata.c
index 96648c176f374f10ab3ec079a5480f73dcdb2229..21546937db39bf5fb968af60a7ee5b096242925b 100644 (file)
@@ -17,6 +17,9 @@
 static bool errata_probe_pbmt(unsigned int stage,
                              unsigned long arch_id, unsigned long impid)
 {
+       if (!IS_ENABLED(CONFIG_ERRATA_THEAD_PBMT))
+               return false;
+
        if (arch_id != 0 || impid != 0)
                return false;
 
@@ -30,7 +33,9 @@ static bool errata_probe_pbmt(unsigned int stage,
 static bool errata_probe_cmo(unsigned int stage,
                             unsigned long arch_id, unsigned long impid)
 {
-#ifdef CONFIG_ERRATA_THEAD_CMO
+       if (!IS_ENABLED(CONFIG_ERRATA_THEAD_CMO))
+               return false;
+
        if (arch_id != 0 || impid != 0)
                return false;
 
@@ -40,9 +45,6 @@ static bool errata_probe_cmo(unsigned int stage,
        riscv_cbom_block_size = L1_CACHE_BYTES;
        riscv_noncoherent_supported();
        return true;
-#else
-       return false;
-#endif
 }
 
 static u32 thead_errata_probe(unsigned int stage,
@@ -51,10 +53,10 @@ static u32 thead_errata_probe(unsigned int stage,
        u32 cpu_req_errata = 0;
 
        if (errata_probe_pbmt(stage, archid, impid))
-               cpu_req_errata |= (1U << ERRATA_THEAD_PBMT);
+               cpu_req_errata |= BIT(ERRATA_THEAD_PBMT);
 
        if (errata_probe_cmo(stage, archid, impid))
-               cpu_req_errata |= (1U << ERRATA_THEAD_CMO);
+               cpu_req_errata |= BIT(ERRATA_THEAD_CMO);
 
        return cpu_req_errata;
 }