openocd: manually fix Yoda conditions
[fw/openocd] / src / target / riscv / riscv_semihosting.c
index c0e81eae4036b015a559290505bbce023cc01773..90b8ddb4fcb8ac107ebcb0cd244beef2f5aaf7f8 100644 (file)
@@ -137,7 +137,7 @@ semihosting_result_t riscv_semihosting(struct target *target, int *retval)
                semihosting->word_size_bytes = riscv_xlen(target) / 8;
 
                /* Check for ARM operation numbers. */
-               if (0 <= semihosting->op && semihosting->op <= 0x31) {
+               if (semihosting->op >= 0 && semihosting->op <= 0x31) {
                        *retval = semihosting_common(target);
                        if (*retval != ERROR_OK) {
                                LOG_ERROR("Failed semihosting operation (0x%02X)", semihosting->op);