Re: [PATCH - alsa-lib 1/3] tlv: Check out of range dB with SND_CTL_TLVT_DB_RANGE

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

 



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



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

  Powered by Linux