Re: [PATCH v6 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:14 PM, Jonas Gorski <jogo@xxxxxxxxxxx> wrote:
> On Tue, Apr 8, 2014 at 12:54 PM, Manuel Lauss <manuel.lauss@xxxxxxxxx> wrote:
>> This small patch makes the floating point support and the FPU-emulator
>> optional.  A Warning will be printed once when first use of floating
>> point is detected.
>>
>> Disabling fpu support shrinks vmlinux by about 54kBytes (32bit,
>> optimizing for size), and it is mainly useful for embedded devices
>> which have no need for float math (e.g. routers).
>>
>> Signed-off-by: Manuel Lauss <manuel.lauss@xxxxxxxxx>
>> ---
>
> (snip)
>
>> diff --git a/arch/mips/include/asm/fpu.h b/arch/mips/include/asm/fpu.h
>> index 4d86b72..c3d418d 100644
>> --- a/arch/mips/include/asm/fpu.h
>> +++ b/arch/mips/include/asm/fpu.h
>> @@ -154,17 +154,26 @@ static inline void lose_fpu(int save)
>>  static inline int init_fpu(void)
>>  {
>>         int ret = 0;
>> +       static int first = 1;
>
> This one could go into the else branch of (IS_ENABLED(CONFIG_MIPS_FPU_SUPPORT)).
> [...]
> Braces belong on all branches of a conditional, see Chapter 3 of CodingStyle.

Done x2

>> +               preempt_enable();
>>         } else {
>> -               fpu_emulator_init_fpu();
>> +               if (likely(first)) {
>> +                       first = 0;
>> +                       pr_err("FPU support disabled, but FPU use "
>> +                              "detected! Make sure you have a "
>> +                              "softfloat userspace!\n");
>
> Don't split strings, it makes it hard to grep for and they have a
> special exception to exceed the normal 80 characters per line limit
> (Checkpatch does not complain about it). See also Chapter 2 of
> CodingStyle.

I'll trim the text a bit as well.

Thanks!
       Manuel


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

  Powered by Linux