
20 Jul
2010
20 Jul
'10
8:34 a.m.
On Monday 19 July 2010 18:48:06 ext Takashi Iwai wrote:
if (snd_tlv_get_dB_range(tlv, rangemin, rangemax,
&dbmin, &dbmax))
return -EINVAL;
if (db_gain <= dbmin || db_gain >= dbmax) {
*value = db_gain <= dbmin ? rangemin : rangemax;
return 0;
}
The check looks good, but IMO, just plain two if's are more intuitive:
if (db_gain <= dbmin) { *value = rangemin; return 0; } else if (db_gain >= dbmax) { *value = rangemax; return 0; }
I will change the check, and resubmit the patch (or the series)
thanks,
Takashi
Thank you, Péter