Re: [PATCH v3 05/14] ASoC: SOF: Add PCM operations support

Andy Shevchenko
2018-12-12T13:12:22Z

On Wed, Dec 12, 2018 at 09:04:38AM +0100, Takashi Iwai wrote:
> On Tue, 11 Dec 2018 22:23:09 +0100,
> Pierre-Louis Bossart wrote:
> >
> > + /* number of pages should be rounded up */
> > + if (runtime->dma_bytes % PAGE_SIZE)
> > + pcm.params.buffer.pages = (runtime->dma_bytes / PAGE_SIZE) + 1;
> > + else
> > + pcm.params.buffer.pages = runtime->dma_bytes / PAGE_SIZE;
>
> There is likely some nice macro for this :)

DIV_ROUND_UP() ?

--
With Best Regards,
Andy Shevchenko