summaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/cpu-probe.c
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2016-05-11 15:50:27 +0100
committerRalf Baechle <ralf@linux-mips.org>2016-05-13 15:30:25 +0200
commit9e575f753576d85e83ae0afc27eca9708259a797 (patch)
tree3a8c171b002fed3835b6446d9bd25c80febe040d /arch/mips/kernel/cpu-probe.c
parent30228c40f0c6f0a93910325f120904505a4c39cc (diff)
downloadlinux-stable-9e575f753576d85e83ae0afc27eca9708259a797.tar.gz
linux-stable-9e575f753576d85e83ae0afc27eca9708259a797.tar.bz2
linux-stable-9e575f753576d85e83ae0afc27eca9708259a797.zip
MIPS: Avoid magic numbers probing kscratch_mask
The decode_config4() function reads kscratch_mask from CP0_Config4.KScrExist using a hard coded shift and mask. We already have a definition for the mask in mipsregs.h, so add a definition for the shift and make use of them. Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/13227/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/cpu-probe.c')
-rw-r--r--arch/mips/kernel/cpu-probe.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 45770d83c3f0..31c27576a931 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -801,7 +801,8 @@ static inline unsigned int decode_config4(struct cpuinfo_mips *c)
}
}
- c->kscratch_mask = (config4 >> 16) & 0xff;
+ c->kscratch_mask = (config4 & MIPS_CONF4_KSCREXIST)
+ >> MIPS_CONF4_KSCREXIST_SHIFT;
asid_mask = MIPS_ENTRYHI_ASID;
if (config4 & MIPS_CONF4_AE)