linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: linux-4.20-rc1/sound/soc/stm/stm32_sai_sub.c:343: Faulty error check
       [not found] <VI1PR08MB3342060AF73044939F5273F59CCA0@VI1PR08MB3342.eurprd08.prod.outlook.com>
@ 2018-11-05 14:24 ` Arnaud Pouliquen
  0 siblings, 0 replies; only message in thread
From: Arnaud Pouliquen @ 2018-11-05 14:24 UTC (permalink / raw)
  To: David Binderman, Olivier MOYSAN, lgirdwood, broonie, perex,
	tiwai, mcoquelin.stm32, Alexandre TORGUE, alsa-devel,
	linux-stm32, linux-arm-kernel, linux-kernel

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-11-05 14:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <VI1PR08MB3342060AF73044939F5273F59CCA0@VI1PR08MB3342.eurprd08.prod.outlook.com>
2018-11-05 14:24 ` linux-4.20-rc1/sound/soc/stm/stm32_sai_sub.c:343: Faulty error check Arnaud Pouliquen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).