[Sound-open-firmware] [PATCH 10/15] [RFC][v2]DMIC: Add min/max, ceil divide, find number, and normalize utils

Seppo Ingalsuo seppo.ingalsuo at linux.intel.com
Mon May 7 16:12:47 CEST 2018



On 07.05.2018 14:19, Liam Girdwood wrote:
> On Fri, 2018-05-04 at 18:01 +0300, Seppo Ingalsuo wrote:
>> +
>> +/* This is a divide function that returns ceil of the quotient.
>> + * E.g. ceil_divide(9, 3) returns 3, ceil_divide(10, 3) returns 4.
>> + */
>> +int ceil_divide(int a, int b)
>> +{
>> +       int c;
>> +
>> +       c = a / b;
>> +       if (c * b < a)
>> +               c++;
>> +
>> +       return c;
>> +}
> This one should be static inline.

Please reconsider. Due to code size saving I'd not prefer inline code 
when low benefit. Division should not be used in speed critical code 
parts so not inlining this shouldn't be an issue in typical usage.

I didn't yet patch other similar division code parts but e.g. SRC would 
also use this library function in initialization code.

Thanks,
Seppo


>
> Liam
> _______________________________________________
> Sound-open-firmware mailing list
> Sound-open-firmware at alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
>



More information about the Sound-open-firmware mailing list