linux-4.20-rc1/sound/soc/stm/stm32_sai_sub.c:343: Faulty error check

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

 



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
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux