Re: [PATCH] platform/x86: acer-wmi: use true and false for boolean values

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

 



On Sun, Aug 5, 2018 at 3:18 AM, Gustavo A. R. Silva
<gustavo@xxxxxxxxxxxxxx> wrote:
> Return statements in functions returning bool should use true or false
> instead of an integer value.
>
> This code was detected with the help of Coccinelle.

>  static bool has_cap(u32 cap)
>  {
>         if ((interface->capability & cap) != 0)
> -               return 1;
> +               return true;
>
> -       return 0;
> +       return false;
>  }

this entire function can be oneliner:

return !!(...);


-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux