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@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware