]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
riscv: Change check_unaligned_access_speed_all_cpus to void
authorAndrew Jones <ajones@ventanamicro.com>
Tue, 4 Mar 2025 12:00:19 +0000 (13:00 +0100)
committerAlexandre Ghiti <alexghiti@rivosinc.com>
Wed, 19 Mar 2025 14:23:29 +0000 (14:23 +0000)
The return value of check_unaligned_access_speed_all_cpus() is always
zero, so make the function void so we don't need to concern ourselves
with it. The change also allows us to tidy up
check_unaligned_access_all_cpus() a bit.

Reviewed-by: Clément Léger <cleger@rivosinc.com>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Link: https://lore.kernel.org/r/20250304120014.143628-14-ajones@ventanamicro.com
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
arch/riscv/kernel/unaligned_access_speed.c

index 02b485dc4bc429c2835b10b977ad8866e92af8ba..780f1c5f512a4e58ee876a86fd7508303c0eefa0 100644 (file)
@@ -218,7 +218,7 @@ static int riscv_offline_cpu(unsigned int cpu)
 }
 
 /* Measure unaligned access speed on all CPUs present at boot in parallel. */
-static int __init check_unaligned_access_speed_all_cpus(void)
+static void __init check_unaligned_access_speed_all_cpus(void)
 {
        unsigned int cpu;
        unsigned int cpu_count = num_possible_cpus();
@@ -226,7 +226,7 @@ static int __init check_unaligned_access_speed_all_cpus(void)
 
        if (!bufs) {
                pr_warn("Allocation failure, not measuring misaligned performance\n");
-               return 0;
+               return;
        }
 
        /*
@@ -261,12 +261,10 @@ out:
        }
 
        kfree(bufs);
-       return 0;
 }
 #else /* CONFIG_RISCV_PROBE_UNALIGNED_ACCESS */
-static int __init check_unaligned_access_speed_all_cpus(void)
+static void __init check_unaligned_access_speed_all_cpus(void)
 {
-       return 0;
 }
 #endif
 
@@ -403,10 +401,10 @@ static int __init vec_check_unaligned_access_speed_all_cpus(void *unused __alway
 
 static int __init check_unaligned_access_all_cpus(void)
 {
-       bool all_cpus_emulated;
        int cpu;
 
-       all_cpus_emulated = check_unaligned_access_emulated_all_cpus();
+       if (!check_unaligned_access_emulated_all_cpus())
+               check_unaligned_access_speed_all_cpus();
 
        if (!has_vector()) {
                for_each_online_cpu(cpu)
@@ -417,9 +415,6 @@ static int __init check_unaligned_access_all_cpus(void)
                            NULL, "vec_check_unaligned_access_speed_all_cpus");
        }
 
-       if (!all_cpus_emulated)
-               return check_unaligned_access_speed_all_cpus();
-
        return 0;
 }