Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
Linux-Kernel Archive: Re: [PATCH] arch/mips/kernel/traps: add CONFIG_MIPS_FP_SUPPORT when using handle_fpe Re: [PATCH] arch/mips/kernel/traps: add CONFIG_MIPS_FP_SUPPORT when using handle_fpe From: Maciej W. Rozycki Date: Tue Apr 26 2022 - 20:40:21 EST Next message: Zan Aziz: "Re: [PATCH 5.17 000/146] 5.17.5-rc1 review" Previous message: John Johansen: "Re: [PATCH v35 08/29] LSM: Use lsmblob in security_secctx_to_secid" In reply to: Stephen Zhang: "[PATCH] arch/mips/kernel/traps: add CONFIG_MIPS_FP_SUPPORT when using handle_fpe" Next in thread: Stephen Zhang: "Re: [PATCH] arch/mips/kernel/traps: add CONFIG_MIPS_FP_SUPPORT when using handle_fpe" Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] On Tue, 26 Apr 2022, Stephen Zhang wrote: > diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c > index 246c6a6b0261..ef9792261f91 100644 > --- a/arch/mips/kernel/traps.c > +++ b/arch/mips/kernel/traps.c > @@ -90,7 +90,9 @@ extern asmlinkage void handle_cpu(void); > extern asmlinkage void handle_ov(void); > extern asmlinkage void handle_tr(void); > extern asmlinkage void handle_msa_fpe(void); > +#ifdef CONFIG_MIPS_FP_SUPPORT > extern asmlinkage void handle_fpe(void); > +#endif No need to conditionalise declarations ever. > @@ -2489,8 +2491,10 @@ void __init trap_init(void) > if (board_nmi_handler_setup) > board_nmi_handler_setup(); > > +#ifdef CONFIG_MIPS_FP_SUPPORT > if (cpu_has_fpu && !cpu_has_nofpuex) > set_except_vector(EXCCODE_FPE, handle_fpe); > +#endif No need to conditionalise this either, because `cpu_has_fpu' is forced 0 (in arch/mips/include/asm/cpu-features.h) if !CONFIG_MIPS_FP_SUPPORT. So this code translates to: if (0 && !0) set_except_vector(15, handle_fpe); in the preprocessor if CONFIG_MIPS_FP_SUPPORT is unset and is optimised away. Otherwise it should be written as: if (IS_ENABLED(CONFIG_MIPS_FP_SUPPORT) && ... so as not to clutter C code with #ifdef, as per our coding style. Maciej Next message: Zan Aziz: "Re: [PATCH 5.17 000/146] 5.17.5-rc1 review" Previous message: John Johansen: "Re: [PATCH v35 08/29] LSM: Use lsmblob in security_secctx_to_secid" In reply to: Stephen Zhang: "[PATCH] arch/mips/kernel/traps: add CONFIG_MIPS_FP_SUPPORT when using handle_fpe" Next in thread: Stephen Zhang: "Re: [PATCH] arch/mips/kernel/traps: add CONFIG_MIPS_FP_SUPPORT when using handle_fpe" Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]