linux-6.5/sound/soc/codecs/rt722-sdca.c:612: some confused logic ?

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

 



Hello there,

I just ran cppcheck over the source code of linux-6.5. It said:

linux-6.5/sound/soc/codecs/rt722-sdca.c:612:8: style: Expression is always true because 'else if' condition is opposite to previous condition at line 609. [multiCondition]

Source code is

        if (!adc_vol_flag) /* boost gain */
            ctl = regvalue / boost_step;
        else { /* ADC gain */
            if (adc_vol_flag)
                ctl = p->max - (((vol_max - regvalue) & 0xffff) / interval_offset);
            else
                ctl = p->max - (((0 - regvalue) & 0xffff) / interval_offset);
        }

This code might benefit from some rework.

Regards

David Binderman




[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