]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/mips/mm/tlbex.c
MIPS: Fixup check for invalid scratch register
[karo-tx-linux.git] / arch / mips / mm / tlbex.c
index c052df8ae7d7daf9249938fe19e4a8d09d40c4c5..9b988c050fddfd749978d6ae70674c2bd39f3caf 100644 (file)
@@ -345,7 +345,7 @@ static struct work_registers __cpuinit build_get_work_registers(u32 **p)
        int smp_processor_id_sel;
        int smp_processor_id_shift;
 
-       if (scratch_reg > 0) {
+       if (scratch_reg >= 0) {
                /* Save in CPU local C0_KScratch? */
                UASM_i_MTC0(p, 1, c0_kscratch(), scratch_reg);
                r.r1 = K0;
@@ -395,7 +395,7 @@ static struct work_registers __cpuinit build_get_work_registers(u32 **p)
 
 static void __cpuinit build_restore_work_registers(u32 **p)
 {
-       if (scratch_reg > 0) {
+       if (scratch_reg >= 0) {
                UASM_i_MFC0(p, 1, c0_kscratch(), scratch_reg);
                return;
        }
@@ -684,7 +684,7 @@ static __cpuinit void build_restore_pagemask(u32 **p,
                        uasm_i_mtc0(p, 0, C0_PAGEMASK);
                        uasm_il_b(p, r, lid);
                }
-               if (scratch_reg > 0)
+               if (scratch_reg >= 0)
                        UASM_i_MFC0(p, 1, c0_kscratch(), scratch_reg);
                else
                        UASM_i_LW(p, 1, scratchpad_offset(0), 0);
@@ -940,7 +940,7 @@ build_get_pgd_vmalloc64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
                uasm_i_jr(p, ptr);
 
                if (mode == refill_scratch) {
-                       if (scratch_reg > 0)
+                       if (scratch_reg >= 0)
                                UASM_i_MFC0(p, 1, c0_kscratch(), scratch_reg);
                        else
                                UASM_i_LW(p, 1, scratchpad_offset(0), 0);
@@ -1297,7 +1297,7 @@ static void __cpuinit build_r4000_tlb_refill_handler(void)
        memset(relocs, 0, sizeof(relocs));
        memset(final_handler, 0, sizeof(final_handler));
 
-       if ((scratch_reg > 0 || scratchpad_available()) && use_bbit_insns()) {
+       if ((scratch_reg >= 0 || scratchpad_available()) && use_bbit_insns()) {
                htlb_info = build_fast_tlb_refill_handler(&p, &l, &r, K0, K1,
                                                          scratch_reg);
                vmalloc_mode = refill_scratch;