riscv: Set unaligned access speed at compile time
[linux-2.6-microblaze.git] / arch / riscv / kernel / traps_misaligned.c
index e557181..2adb7c3 100644 (file)
@@ -413,7 +413,9 @@ int handle_misaligned_load(struct pt_regs *regs)
 
        perf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, regs, addr);
 
+#ifdef CONFIG_RISCV_PROBE_UNALIGNED_ACCESS
        *this_cpu_ptr(&misaligned_access_speed) = RISCV_HWPROBE_MISALIGNED_EMULATED;
+#endif
 
        if (!unaligned_enabled)
                return -1;