From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Shevchenko Subject: Re: [PATCH v3 05/14] ASoC: SOF: Add PCM operations support Date: Wed, 12 Dec 2018 15:12:22 +0200 Message-ID: <20181212131222.GQ10650@smile.fi.intel.com> References: <20181211212318.28644-1-pierre-louis.bossart@linux.intel.com> <20181211212318.28644-6-pierre-louis.bossart@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Takashi Iwai Cc: Daniel Baluta , alsa-devel@alsa-project.org, Pierre-Louis Bossart , liam.r.girdwood@linux.intel.com, vkoul@kernel.org, broonie@kernel.org, Alan Cox , sound-open-firmware@alsa-project.org List-Id: alsa-devel@alsa-project.org 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