Re: [PATCH v7 2/2] MIPS: optional floating point support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 8, 2014 at 1:37 PM, Manuel Lauss <manuel.lauss@xxxxxxxxx> wrote:
> (snip)
> diff --git a/arch/mips/include/asm/fpu.h b/arch/mips/include/asm/fpu.h
> index 4d86b72..954f52d 100644
> --- a/arch/mips/include/asm/fpu.h
> +++ b/arch/mips/include/asm/fpu.h
> @@ -155,16 +155,24 @@ static inline int init_fpu(void)
>  {
>         int ret = 0;
>
> -       preempt_disable();
> -       if (cpu_has_fpu) {
> -               ret = __own_fpu();
> -               if (!ret)
> -                       _init_fpu();
> +       if (IS_ENABLED(CONFIG_MIPS_FPU_SUPPORT)) {
> +               preempt_disable();
> +               if (cpu_has_fpu) {
> +                       ret = __own_fpu();
> +                       if (!ret)
> +                               _init_fpu();
> +               } else {
> +                       fpu_emulator_init_fpu();
> +               }
> +               preempt_enable();
>         } else {
> -               fpu_emulator_init_fpu();
> +               static int first = 1;

I really hate to nitpick again but ... empty line after variable
definition, please?

> +               if (likely(first)) {
> +                       first = 0;
> +                       pr_err("FPU support disabled, but FPU use detected!\n");
> +               }
> +               ret = SIGILL;
>         }
> -
> -       preempt_enable();
>         return ret;
>  }


Regards
Jonas


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux