Commit 97f2645f authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Linus Torvalds

tree-wide: replace config_enabled() with IS_ENABLED()

The use of config_enabled() against config options is ambiguous.  In
practical terms, config_enabled() is equivalent to IS_BUILTIN(), but the
author might have used it for the meaning of IS_ENABLED().  Using
IS_ENABLED(), IS_BUILTIN(), IS_MODULE() etc.  makes the intention
clearer.

This commit replaces config_enabled() with IS_ENABLED() where possible.
This commit is only touching bool config options.

I noticed two cases where config_enabled() is used against a tristate
option:

 - config_enabled(CONFIG_HWMON)
  [ drivers/net/wireless/ath/ath10k/thermal.c ]

 - config_enabled(CONFIG_BACKLIGHT_CLASS_DEVICE)
  [ drivers/gpu/drm/gma500/opregion.c ]

I did not touch them because they should be converted to IS_BUILTIN()
in order to keep the logic, but I was not sure it was the authors'
intention.

Link: http://lkml.kernel.org/r/1465215656-20569-1-git-send-email-yamada.masahiro@socionext.comSigned-off-by: Masahiro Yamada's avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: default avatarKees Cook <keescook@chromium.org>
Cc: Stas Sergeev <stsp@list.ru>
Cc: Matt Redfearn <matt.redfearn@imgtec.com>
Cc: Joshua Kinard <kumba@gentoo.org>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Cc: "Dmitry V. Levin" <ldv@altlinux.org>
Cc: yu-cheng yu <yu-cheng.yu@intel.com>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Will Drewry <wad@chromium.org>
Cc: Nikolay Martynov <mar.kolya@gmail.com>
Cc: Huacai Chen <chenhc@lemote.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Cc: Rafal Milecki <zajec5@gmail.com>
Cc: James Cowgill <James.Cowgill@imgtec.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Alex Smith <alex.smith@imgtec.com>
Cc: Adam Buchbinder <adam.buchbinder@gmail.com>
Cc: Qais Yousef <qais.yousef@imgtec.com>
Cc: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Mikko Rapeli <mikko.rapeli@iki.fi>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
Cc: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Roland McGrath <roland@hack.frob.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: Kalle Valo <kvalo@qca.qualcomm.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Tony Wu <tung7970@gmail.com>
Cc: Huaitong Han <huaitong.han@intel.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Juergen Gross <jgross@suse.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Andrea Gelmini <andrea.gelmini@gelma.net>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Rabin Vincent <rabin@rab.in>
Cc: "Maciej W. Rozycki" <macro@imgtec.com>
Cc: David Daney <david.daney@cavium.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1c8cb409
...@@ -462,7 +462,7 @@ static inline unsigned int mips_cm_max_vp_width(void) ...@@ -462,7 +462,7 @@ static inline unsigned int mips_cm_max_vp_width(void)
if (mips_cm_revision() >= CM_REV_CM3) if (mips_cm_revision() >= CM_REV_CM3)
return read_gcr_sys_config2() & CM_GCR_SYS_CONFIG2_MAXVPW_MSK; return read_gcr_sys_config2() & CM_GCR_SYS_CONFIG2_MAXVPW_MSK;
if (config_enabled(CONFIG_SMP)) if (IS_ENABLED(CONFIG_SMP))
return smp_num_siblings; return smp_num_siblings;
return 1; return 1;
......
...@@ -159,7 +159,7 @@ static inline void set_pte(pte_t *ptep, pte_t pte) ...@@ -159,7 +159,7 @@ static inline void set_pte(pte_t *ptep, pte_t pte)
* it better already be global) * it better already be global)
*/ */
if (pte_none(*buddy)) { if (pte_none(*buddy)) {
if (!config_enabled(CONFIG_XPA)) if (!IS_ENABLED(CONFIG_XPA))
buddy->pte_low |= _PAGE_GLOBAL; buddy->pte_low |= _PAGE_GLOBAL;
buddy->pte_high |= _PAGE_GLOBAL; buddy->pte_high |= _PAGE_GLOBAL;
} }
...@@ -172,7 +172,7 @@ static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *pt ...@@ -172,7 +172,7 @@ static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *pt
htw_stop(); htw_stop();
/* Preserve global status for the pair */ /* Preserve global status for the pair */
if (config_enabled(CONFIG_XPA)) { if (IS_ENABLED(CONFIG_XPA)) {
if (ptep_buddy(ptep)->pte_high & _PAGE_GLOBAL) if (ptep_buddy(ptep)->pte_high & _PAGE_GLOBAL)
null.pte_high = _PAGE_GLOBAL; null.pte_high = _PAGE_GLOBAL;
} else { } else {
...@@ -319,7 +319,7 @@ static inline int pte_young(pte_t pte) { return pte.pte_low & _PAGE_ACCESSED; } ...@@ -319,7 +319,7 @@ static inline int pte_young(pte_t pte) { return pte.pte_low & _PAGE_ACCESSED; }
static inline pte_t pte_wrprotect(pte_t pte) static inline pte_t pte_wrprotect(pte_t pte)
{ {
pte.pte_low &= ~_PAGE_WRITE; pte.pte_low &= ~_PAGE_WRITE;
if (!config_enabled(CONFIG_XPA)) if (!IS_ENABLED(CONFIG_XPA))
pte.pte_low &= ~_PAGE_SILENT_WRITE; pte.pte_low &= ~_PAGE_SILENT_WRITE;
pte.pte_high &= ~_PAGE_SILENT_WRITE; pte.pte_high &= ~_PAGE_SILENT_WRITE;
return pte; return pte;
...@@ -328,7 +328,7 @@ static inline pte_t pte_wrprotect(pte_t pte) ...@@ -328,7 +328,7 @@ static inline pte_t pte_wrprotect(pte_t pte)
static inline pte_t pte_mkclean(pte_t pte) static inline pte_t pte_mkclean(pte_t pte)
{ {
pte.pte_low &= ~_PAGE_MODIFIED; pte.pte_low &= ~_PAGE_MODIFIED;
if (!config_enabled(CONFIG_XPA)) if (!IS_ENABLED(CONFIG_XPA))
pte.pte_low &= ~_PAGE_SILENT_WRITE; pte.pte_low &= ~_PAGE_SILENT_WRITE;
pte.pte_high &= ~_PAGE_SILENT_WRITE; pte.pte_high &= ~_PAGE_SILENT_WRITE;
return pte; return pte;
...@@ -337,7 +337,7 @@ static inline pte_t pte_mkclean(pte_t pte) ...@@ -337,7 +337,7 @@ static inline pte_t pte_mkclean(pte_t pte)
static inline pte_t pte_mkold(pte_t pte) static inline pte_t pte_mkold(pte_t pte)
{ {
pte.pte_low &= ~_PAGE_ACCESSED; pte.pte_low &= ~_PAGE_ACCESSED;
if (!config_enabled(CONFIG_XPA)) if (!IS_ENABLED(CONFIG_XPA))
pte.pte_low &= ~_PAGE_SILENT_READ; pte.pte_low &= ~_PAGE_SILENT_READ;
pte.pte_high &= ~_PAGE_SILENT_READ; pte.pte_high &= ~_PAGE_SILENT_READ;
return pte; return pte;
...@@ -347,7 +347,7 @@ static inline pte_t pte_mkwrite(pte_t pte) ...@@ -347,7 +347,7 @@ static inline pte_t pte_mkwrite(pte_t pte)
{ {
pte.pte_low |= _PAGE_WRITE; pte.pte_low |= _PAGE_WRITE;
if (pte.pte_low & _PAGE_MODIFIED) { if (pte.pte_low & _PAGE_MODIFIED) {
if (!config_enabled(CONFIG_XPA)) if (!IS_ENABLED(CONFIG_XPA))
pte.pte_low |= _PAGE_SILENT_WRITE; pte.pte_low |= _PAGE_SILENT_WRITE;
pte.pte_high |= _PAGE_SILENT_WRITE; pte.pte_high |= _PAGE_SILENT_WRITE;
} }
...@@ -358,7 +358,7 @@ static inline pte_t pte_mkdirty(pte_t pte) ...@@ -358,7 +358,7 @@ static inline pte_t pte_mkdirty(pte_t pte)
{ {
pte.pte_low |= _PAGE_MODIFIED; pte.pte_low |= _PAGE_MODIFIED;
if (pte.pte_low & _PAGE_WRITE) { if (pte.pte_low & _PAGE_WRITE) {
if (!config_enabled(CONFIG_XPA)) if (!IS_ENABLED(CONFIG_XPA))
pte.pte_low |= _PAGE_SILENT_WRITE; pte.pte_low |= _PAGE_SILENT_WRITE;
pte.pte_high |= _PAGE_SILENT_WRITE; pte.pte_high |= _PAGE_SILENT_WRITE;
} }
...@@ -369,7 +369,7 @@ static inline pte_t pte_mkyoung(pte_t pte) ...@@ -369,7 +369,7 @@ static inline pte_t pte_mkyoung(pte_t pte)
{ {
pte.pte_low |= _PAGE_ACCESSED; pte.pte_low |= _PAGE_ACCESSED;
if (!(pte.pte_low & _PAGE_NO_READ)) { if (!(pte.pte_low & _PAGE_NO_READ)) {
if (!config_enabled(CONFIG_XPA)) if (!IS_ENABLED(CONFIG_XPA))
pte.pte_low |= _PAGE_SILENT_READ; pte.pte_low |= _PAGE_SILENT_READ;
pte.pte_high |= _PAGE_SILENT_READ; pte.pte_high |= _PAGE_SILENT_READ;
} }
......
...@@ -16,10 +16,10 @@ static inline const int *get_compat_mode1_syscalls(void) ...@@ -16,10 +16,10 @@ static inline const int *get_compat_mode1_syscalls(void)
0, /* null terminated */ 0, /* null terminated */
}; };
if (config_enabled(CONFIG_MIPS32_O32) && test_thread_flag(TIF_32BIT_REGS)) if (IS_ENABLED(CONFIG_MIPS32_O32) && test_thread_flag(TIF_32BIT_REGS))
return syscalls_O32; return syscalls_O32;
if (config_enabled(CONFIG_MIPS32_N32)) if (IS_ENABLED(CONFIG_MIPS32_N32))
return syscalls_N32; return syscalls_N32;
BUG(); BUG();
......
...@@ -19,8 +19,8 @@ extern struct mips_abi mips_abi_32; ...@@ -19,8 +19,8 @@ extern struct mips_abi mips_abi_32;
((ka)->sa.sa_flags & SA_SIGINFO)) ((ka)->sa.sa_flags & SA_SIGINFO))
#else #else
#define sig_uses_siginfo(ka, abi) \ #define sig_uses_siginfo(ka, abi) \
(config_enabled(CONFIG_64BIT) ? 1 : \ (IS_ENABLED(CONFIG_64BIT) ? 1 : \
(config_enabled(CONFIG_TRAD_SIGNALS) ? \ (IS_ENABLED(CONFIG_TRAD_SIGNALS) ? \
((ka)->sa.sa_flags & SA_SIGINFO) : 1) ) ((ka)->sa.sa_flags & SA_SIGINFO) : 1) )
#endif #endif
......
...@@ -99,7 +99,7 @@ static inline void syscall_get_arguments(struct task_struct *task, ...@@ -99,7 +99,7 @@ static inline void syscall_get_arguments(struct task_struct *task,
{ {
int ret; int ret;
/* O32 ABI syscall() - Either 64-bit with O32 or 32-bit */ /* O32 ABI syscall() - Either 64-bit with O32 or 32-bit */
if ((config_enabled(CONFIG_32BIT) || if ((IS_ENABLED(CONFIG_32BIT) ||
test_tsk_thread_flag(task, TIF_32BIT_REGS)) && test_tsk_thread_flag(task, TIF_32BIT_REGS)) &&
(regs->regs[2] == __NR_syscall)) (regs->regs[2] == __NR_syscall))
i++; i++;
......
...@@ -88,7 +88,7 @@ extern u64 __ua_limit; ...@@ -88,7 +88,7 @@ extern u64 __ua_limit;
*/ */
static inline bool eva_kernel_access(void) static inline bool eva_kernel_access(void)
{ {
if (!config_enabled(CONFIG_EVA)) if (!IS_ENABLED(CONFIG_EVA))
return false; return false;
return segment_eq(get_fs(), get_ds()); return segment_eq(get_fs(), get_ds());
......
...@@ -75,7 +75,7 @@ void __init device_tree_init(void) ...@@ -75,7 +75,7 @@ void __init device_tree_init(void)
const char *get_system_type(void) const char *get_system_type(void)
{ {
if (config_enabled(CONFIG_MACH_JZ4780)) if (IS_ENABLED(CONFIG_MACH_JZ4780))
return "JZ4780"; return "JZ4780";
return "JZ4740"; return "JZ4740";
......
...@@ -244,7 +244,7 @@ static inline void check_daddi(void) ...@@ -244,7 +244,7 @@ static inline void check_daddi(void)
panic(bug64hit, !DADDI_WAR ? daddiwar : nowar); panic(bug64hit, !DADDI_WAR ? daddiwar : nowar);
} }
int daddiu_bug = config_enabled(CONFIG_CPU_MIPSR6) ? 0 : -1; int daddiu_bug = IS_ENABLED(CONFIG_CPU_MIPSR6) ? 0 : -1;
static inline void check_daddiu(void) static inline void check_daddiu(void)
{ {
...@@ -314,7 +314,7 @@ static inline void check_daddiu(void) ...@@ -314,7 +314,7 @@ static inline void check_daddiu(void)
void __init check_bugs64_early(void) void __init check_bugs64_early(void)
{ {
if (!config_enabled(CONFIG_CPU_MIPSR6)) { if (!IS_ENABLED(CONFIG_CPU_MIPSR6)) {
check_mult_sh(); check_mult_sh();
check_daddiu(); check_daddiu();
} }
...@@ -322,6 +322,6 @@ void __init check_bugs64_early(void) ...@@ -322,6 +322,6 @@ void __init check_bugs64_early(void)
void __init check_bugs64(void) void __init check_bugs64(void)
{ {
if (!config_enabled(CONFIG_CPU_MIPSR6)) if (!IS_ENABLED(CONFIG_CPU_MIPSR6))
check_daddi(); check_daddi();
} }
...@@ -179,7 +179,7 @@ int arch_check_elf(void *_ehdr, bool has_interpreter, void *_interp_ehdr, ...@@ -179,7 +179,7 @@ int arch_check_elf(void *_ehdr, bool has_interpreter, void *_interp_ehdr,
return -ELIBBAD; return -ELIBBAD;
} }
if (!config_enabled(CONFIG_MIPS_O32_FP64_SUPPORT)) if (!IS_ENABLED(CONFIG_MIPS_O32_FP64_SUPPORT))
return 0; return 0;
fp_abi = state->fp_abi; fp_abi = state->fp_abi;
...@@ -285,7 +285,7 @@ void mips_set_personality_fp(struct arch_elf_state *state) ...@@ -285,7 +285,7 @@ void mips_set_personality_fp(struct arch_elf_state *state)
* not be worried about N32/N64 binaries. * not be worried about N32/N64 binaries.
*/ */
if (!config_enabled(CONFIG_MIPS_O32_FP64_SUPPORT)) if (!IS_ENABLED(CONFIG_MIPS_O32_FP64_SUPPORT))
return; return;
switch (state->overall_fp_mode) { switch (state->overall_fp_mode) {
......
...@@ -251,7 +251,7 @@ int mips_cm_probe(void) ...@@ -251,7 +251,7 @@ int mips_cm_probe(void)
mips_cm_probe_l2sync(); mips_cm_probe_l2sync();
/* determine register width for this CM */ /* determine register width for this CM */
mips_cm_is64 = config_enabled(CONFIG_64BIT) && (mips_cm_revision() >= CM_REV_CM3); mips_cm_is64 = IS_ENABLED(CONFIG_64BIT) && (mips_cm_revision() >= CM_REV_CM3);
for_each_possible_cpu(cpu) for_each_possible_cpu(cpu)
spin_lock_init(&per_cpu(cm_core_lock, cpu)); spin_lock_init(&per_cpu(cm_core_lock, cpu));
......
...@@ -84,7 +84,7 @@ static inline int mipsr6_emul(struct pt_regs *regs, u32 ir) ...@@ -84,7 +84,7 @@ static inline int mipsr6_emul(struct pt_regs *regs, u32 ir)
(s32)MIPSInst_SIMM(ir); (s32)MIPSInst_SIMM(ir);
return 0; return 0;
case daddiu_op: case daddiu_op:
if (config_enabled(CONFIG_32BIT)) if (IS_ENABLED(CONFIG_32BIT))
break; break;
if (MIPSInst_RT(ir)) if (MIPSInst_RT(ir))
...@@ -143,7 +143,7 @@ static inline int mipsr6_emul(struct pt_regs *regs, u32 ir) ...@@ -143,7 +143,7 @@ static inline int mipsr6_emul(struct pt_regs *regs, u32 ir)
(u32)regs->regs[MIPSInst_RT(ir)]); (u32)regs->regs[MIPSInst_RT(ir)]);
return 0; return 0;
case dsll_op: case dsll_op:
if (config_enabled(CONFIG_32BIT) || MIPSInst_RS(ir)) if (IS_ENABLED(CONFIG_32BIT) || MIPSInst_RS(ir))
break; break;
if (MIPSInst_RD(ir)) if (MIPSInst_RD(ir))
...@@ -152,7 +152,7 @@ static inline int mipsr6_emul(struct pt_regs *regs, u32 ir) ...@@ -152,7 +152,7 @@ static inline int mipsr6_emul(struct pt_regs *regs, u32 ir)
MIPSInst_FD(ir)); MIPSInst_FD(ir));
return 0; return 0;
case dsrl_op: case dsrl_op:
if (config_enabled(CONFIG_32BIT) || MIPSInst_RS(ir)) if (IS_ENABLED(CONFIG_32BIT) || MIPSInst_RS(ir))
break; break;
if (MIPSInst_RD(ir)) if (MIPSInst_RD(ir))
...@@ -161,7 +161,7 @@ static inline int mipsr6_emul(struct pt_regs *regs, u32 ir) ...@@ -161,7 +161,7 @@ static inline int mipsr6_emul(struct pt_regs *regs, u32 ir)
MIPSInst_FD(ir)); MIPSInst_FD(ir));
return 0; return 0;
case daddu_op: case daddu_op:
if (config_enabled(CONFIG_32BIT) || MIPSInst_FD(ir)) if (IS_ENABLED(CONFIG_32BIT) || MIPSInst_FD(ir))
break; break;
if (MIPSInst_RD(ir)) if (MIPSInst_RD(ir))
...@@ -170,7 +170,7 @@ static inline int mipsr6_emul(struct pt_regs *regs, u32 ir) ...@@ -170,7 +170,7 @@ static inline int mipsr6_emul(struct pt_regs *regs, u32 ir)
(u64)regs->regs[MIPSInst_RT(ir)]; (u64)regs->regs[MIPSInst_RT(ir)];
return 0; return 0;
case dsubu_op: case dsubu_op:
if (config_enabled(CONFIG_32BIT) || MIPSInst_FD(ir)) if (IS_ENABLED(CONFIG_32BIT) || MIPSInst_FD(ir))
break; break;
if (MIPSInst_RD(ir)) if (MIPSInst_RD(ir))
...@@ -498,7 +498,7 @@ static int dmult_func(struct pt_regs *regs, u32 ir) ...@@ -498,7 +498,7 @@ static int dmult_func(struct pt_regs *regs, u32 ir)
s64 res; s64 res;
s64 rt, rs; s64 rt, rs;
if (config_enabled(CONFIG_32BIT)) if (IS_ENABLED(CONFIG_32BIT))
return SIGILL; return SIGILL;
rt = regs->regs[MIPSInst_RT(ir)]; rt = regs->regs[MIPSInst_RT(ir)];
...@@ -530,7 +530,7 @@ static int dmultu_func(struct pt_regs *regs, u32 ir) ...@@ -530,7 +530,7 @@ static int dmultu_func(struct pt_regs *regs, u32 ir)
u64 res; u64 res;
u64 rt, rs; u64 rt, rs;
if (config_enabled(CONFIG_32BIT)) if (IS_ENABLED(CONFIG_32BIT))
return SIGILL; return SIGILL;
rt = regs->regs[MIPSInst_RT(ir)]; rt = regs->regs[MIPSInst_RT(ir)];
...@@ -561,7 +561,7 @@ static int ddiv_func(struct pt_regs *regs, u32 ir) ...@@ -561,7 +561,7 @@ static int ddiv_func(struct pt_regs *regs, u32 ir)
{ {
s64 rt, rs; s64 rt, rs;
if (config_enabled(CONFIG_32BIT)) if (IS_ENABLED(CONFIG_32BIT))
return SIGILL; return SIGILL;
rt = regs->regs[MIPSInst_RT(ir)]; rt = regs->regs[MIPSInst_RT(ir)];
...@@ -586,7 +586,7 @@ static int ddivu_func(struct pt_regs *regs, u32 ir) ...@@ -586,7 +586,7 @@ static int ddivu_func(struct pt_regs *regs, u32 ir)
{ {
u64 rt, rs; u64 rt, rs;
if (config_enabled(CONFIG_32BIT)) if (IS_ENABLED(CONFIG_32BIT))
return SIGILL; return SIGILL;
rt = regs->regs[MIPSInst_RT(ir)]; rt = regs->regs[MIPSInst_RT(ir)];
...@@ -825,7 +825,7 @@ static int dclz_func(struct pt_regs *regs, u32 ir) ...@@ -825,7 +825,7 @@ static int dclz_func(struct pt_regs *regs, u32 ir)
u64 res; u64 res;
u64 rs; u64 rs;
if (config_enabled(CONFIG_32BIT)) if (IS_ENABLED(CONFIG_32BIT))
return SIGILL; return SIGILL;
if (!MIPSInst_RD(ir)) if (!MIPSInst_RD(ir))
...@@ -852,7 +852,7 @@ static int dclo_func(struct pt_regs *regs, u32 ir) ...@@ -852,7 +852,7 @@ static int dclo_func(struct pt_regs *regs, u32 ir)
u64 res; u64 res;
u64 rs; u64 rs;
if (config_enabled(CONFIG_32BIT)) if (IS_ENABLED(CONFIG_32BIT))
return SIGILL; return SIGILL;
if (!MIPSInst_RD(ir)) if (!MIPSInst_RD(ir))
...@@ -1484,7 +1484,7 @@ fpu_emul: ...@@ -1484,7 +1484,7 @@ fpu_emul:
break; break;
case ldl_op: case ldl_op:
if (config_enabled(CONFIG_32BIT)) { if (IS_ENABLED(CONFIG_32BIT)) {
err = SIGILL; err = SIGILL;
break; break;
} }
...@@ -1603,7 +1603,7 @@ fpu_emul: ...@@ -1603,7 +1603,7 @@ fpu_emul:
break; break;
case ldr_op: case ldr_op:
if (config_enabled(CONFIG_32BIT)) { if (IS_ENABLED(CONFIG_32BIT)) {
err = SIGILL; err = SIGILL;
break; break;
} }
...@@ -1722,7 +1722,7 @@ fpu_emul: ...@@ -1722,7 +1722,7 @@ fpu_emul:
break; break;
case sdl_op: case sdl_op:
if (config_enabled(CONFIG_32BIT)) { if (IS_ENABLED(CONFIG_32BIT)) {
err = SIGILL; err = SIGILL;
break; break;
} }
...@@ -1840,7 +1840,7 @@ fpu_emul: ...@@ -1840,7 +1840,7 @@ fpu_emul:
break; break;
case sdr_op: case sdr_op:
if (config_enabled(CONFIG_32BIT)) { if (IS_ENABLED(CONFIG_32BIT)) {
err = SIGILL; err = SIGILL;
break; break;
} }
...@@ -2072,7 +2072,7 @@ fpu_emul: ...@@ -2072,7 +2072,7 @@ fpu_emul:
break; break;
case lld_op: case lld_op:
if (config_enabled(CONFIG_32BIT)) { if (IS_ENABLED(CONFIG_32BIT)) {
err = SIGILL; err = SIGILL;
break; break;
} }
...@@ -2133,7 +2133,7 @@ fpu_emul: ...@@ -2133,7 +2133,7 @@ fpu_emul:
break; break;
case scd_op: case scd_op:
if (config_enabled(CONFIG_32BIT)) { if (IS_ENABLED(CONFIG_32BIT)) {
err = SIGILL; err = SIGILL;
break; break;
} }
......
...@@ -148,7 +148,7 @@ int cps_pm_enter_state(enum cps_pm_state state) ...@@ -148,7 +148,7 @@ int cps_pm_enter_state(enum cps_pm_state state)
} }
/* Setup the VPE to run mips_cps_pm_restore when started again */ /* Setup the VPE to run mips_cps_pm_restore when started again */
if (config_enabled(CONFIG_CPU_PM) && state == CPS_PM_POWER_GATED) { if (IS_ENABLED(CONFIG_CPU_PM) && state == CPS_PM_POWER_GATED) {
/* Power gating relies upon CPS SMP */ /* Power gating relies upon CPS SMP */
if (!mips_cps_smp_in_use()) if (!mips_cps_smp_in_use())
return -EINVAL; return -EINVAL;
...@@ -387,7 +387,7 @@ static void * __init cps_gen_entry_code(unsigned cpu, enum cps_pm_state state) ...@@ -387,7 +387,7 @@ static void * __init cps_gen_entry_code(unsigned cpu, enum cps_pm_state state)
memset(labels, 0, sizeof(labels)); memset(labels, 0, sizeof(labels));
memset(relocs, 0, sizeof(relocs)); memset(relocs, 0, sizeof(relocs));
if (config_enabled(CONFIG_CPU_PM) && state == CPS_PM_POWER_GATED) { if (IS_ENABLED(CONFIG_CPU_PM) && state == CPS_PM_POWER_GATED) {
/* Power gating relies upon CPS SMP */ /* Power gating relies upon CPS SMP */
if (!mips_cps_smp_in_use()) if (!mips_cps_smp_in_use())
goto out_err; goto out_err;
......
...@@ -165,7 +165,7 @@ static int save_msa_extcontext(void __user *buf) ...@@ -165,7 +165,7 @@ static int save_msa_extcontext(void __user *buf)
* should already have been done when handling scalar FP * should already have been done when handling scalar FP
* context. * context.
*/ */
BUG_ON(config_enabled(CONFIG_EVA)); BUG_ON(IS_ENABLED(CONFIG_EVA));
err = __put_user(read_msa_csr(), &msa->csr); err = __put_user(read_msa_csr(), &msa->csr);
err |= _save_msa_all_upper(&msa->wr); err |= _save_msa_all_upper(&msa->wr);
...@@ -195,7 +195,7 @@ static int restore_msa_extcontext(void __user *buf, unsigned int size) ...@@ -195,7 +195,7 @@ static int restore_msa_extcontext(void __user *buf, unsigned int size)
unsigned int csr; unsigned int csr;
int i, err; int i, err;
if (!config_enabled(CONFIG_CPU_HAS_MSA)) if (!IS_ENABLED(CONFIG_CPU_HAS_MSA))
return SIGSYS; return SIGSYS;
if (size != sizeof(*msa)) if (size != sizeof(*msa))
...@@ -215,7 +215,7 @@ static int restore_msa_extcontext(void __user *buf, unsigned int size) ...@@ -215,7 +215,7 @@ static int restore_msa_extcontext(void __user *buf, unsigned int size)
* scalar FP context, so FPU & MSA should have already been * scalar FP context, so FPU & MSA should have already been
* disabled whilst handling scalar FP context. * disabled whilst handling scalar FP context.
*/ */
BUG_ON(config_enabled(CONFIG_EVA)); BUG_ON(IS_ENABLED(CONFIG_EVA));
write_msa_csr(csr); write_msa_csr(csr);
err |= _restore_msa_all_upper(&msa->wr); err |= _restore_msa_all_upper(&msa->wr);
...@@ -315,7 +315,7 @@ int protected_save_fp_context(void __user *sc) ...@@ -315,7 +315,7 @@ int protected_save_fp_context(void __user *sc)
* EVA does not have userland equivalents of ldc1 or sdc1, so * EVA does not have userland equivalents of ldc1 or sdc1, so
* save to the kernel FP context & copy that to userland below. * save to the kernel FP context & copy that to userland below.
*/ */
if (config_enabled(CONFIG_EVA)) if (IS_ENABLED(CONFIG_EVA))
lose_fpu(1); lose_fpu(1);
while (1) { while (1) {
...@@ -378,7 +378,7 @@ int protected_restore_fp_context(void __user *sc) ...@@ -378,7 +378,7 @@ int protected_restore_fp_context(void __user *sc)
* disable the FPU here such that the code below simply copies to * disable the FPU here such that the code below simply copies to
* the kernel FP context. * the kernel FP context.
*/ */
if (config_enabled(CONFIG_EVA)) if (IS_ENABLED(CONFIG_EVA))
lose_fpu(0); lose_fpu(0);
while (1) { while (1) {
......
...@@ -46,8 +46,8 @@ static unsigned core_vpe_count(unsigned core) ...@@ -46,8 +46,8 @@ static unsigned core_vpe_count(unsigned core)
if (threads_disabled) if (threads_disabled)
return 1; return 1;
if ((!config_enabled(CONFIG_MIPS_MT_SMP) || !cpu_has_mipsmt) if ((!IS_ENABLED(CONFIG_MIPS_MT_SMP) || !cpu_has_mipsmt)
&& (!config_enabled(CONFIG_CPU_MIPSR6) || !cpu_has_vp)) && (!IS_ENABLED(CONFIG_CPU_MIPSR6) || !cpu_has_vp))
return 1; return 1;
mips_cm_lock_other(core, 0); mips_cm_lock_other(core, 0);
......
...@@ -1025,7 +1025,7 @@ static void emulate_load_store_insn(struct pt_regs *regs, ...@@ -1025,7 +1025,7 @@ static void emulate_load_store_insn(struct pt_regs *regs,
if (!access_ok(VERIFY_READ, addr, 2)) if (!access_ok(VERIFY_READ, addr, 2))
goto sigbus; goto sigbus;
if (config_enabled(CONFIG_EVA)) { if (IS_ENABLED(CONFIG_EVA)) {
if (segment_eq(get_fs(), get_ds())) if (segment_eq(get_fs(), get_ds()))
LoadHW(addr, value, res); LoadHW(addr, value, res);
else else
...@@ -1044,7 +1044,7 @@ static void emulate_load_store_insn(struct pt_regs *regs, ...@@ -1044,7 +1044,7 @@ static void emulate_load_store_insn(struct pt_regs *regs,
if (!access_ok(VERIFY_READ, addr, 4)) if (!access_ok(VERIFY_READ, addr, 4))
goto sigbus; goto sigbus;
if (config_enabled(CONFIG_EVA)) { if (IS_ENABLED(CONFIG_EVA)) {
if (segment_eq(get_fs(), get_ds())) if (segment_eq(get_fs(), get_ds()))
LoadW(addr, value, res); LoadW(addr, value, res);
else else
...@@ -1063,7 +1063,7 @@ static void emulate_load_store_insn(struct pt_regs *regs, ...@@ -1063,7 +1063,7 @@ static void emulate_load_store_insn(struct pt_regs *regs,
if (!access_ok(VERIFY_READ, addr, 2)) if (!access_ok(VERIFY_READ, addr, 2))
goto sigbus; goto sigbus;
if (config_enabled(CONFIG_EVA)) { if (IS_ENABLED(CONFIG_EVA)) {
if (segment_eq(get_fs(), get_ds())) if (segment_eq(get_fs(), get_ds()))
LoadHWU(addr, value, res); LoadHWU(addr, value, res);
else else
...@@ -1131,7 +1131,7 @@ static void emulate_load_store_insn(struct pt_regs *regs, ...@@ -1131,7 +1131,7 @@ static void emulate_load_store_insn(struct pt_regs *regs,
compute_return_epc(regs); compute_return_epc(regs);
value = regs->regs[insn.i_format.rt]; value = regs->regs[insn.i_format.rt];
if (config_enabled(CONFIG_EVA)) { if (IS_ENABLED(CONFIG_EVA)) {
if (segment_eq(get_fs(), get_ds())) if (segment_eq(get_fs(), get_ds()))
StoreHW(addr, value, res); StoreHW(addr, value, res);
else