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

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

 



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


_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



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

  Powered by Linux