lkml.org 
[lkml]   [2018]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: linux-4.20-rc1/sound/soc/stm/stm32_sai_sub.c:343: Faulty error check
From
Date
Hello David,

On 11/5/18 2:33 PM, David Binderman wrote:
> Hello there,
>
> linux-4.20-rc1/sound/soc/stm/stm32_sai_sub.c:343]: (style) Checking if
> unsigned variable 'div' is less than zero.
>
> Source code is
>
>         div = stm32_sai_get_clk_div(sai, parent_rate, rate);
>         if (div < 0)
>                 return div;
>
> Suggest store return value from function in int local variable, test it
> and only then assign it into an unsigned variable.
>
> Regards
>
> David Binderman

Thanks for your feedback, a patch has already been sent and applied to
fix this warning: https://lkml.org/lkml/2018/11/5/510.

Regards,
Arnaud

\
 
 \ /
  Last update: 2018-11-05 15:25    [W:0.024 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site