From: Pierre-Louis Bossart Date: Wed, 25 Jul 2018 20:15:56 +0000 (-0500) Subject: ALSA: memalloc: declare snd_sgbuf_aligned_pages() unconditionally X-Git-Tag: Ubuntu-5.10.0-12.13~6994^2^2~104^2 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=4cae99d9b5305ab8cccc839fccceb81ec9e5abda;p=mirror_ubuntu-hirsute-kernel.git ALSA: memalloc: declare snd_sgbuf_aligned_pages() unconditionally Make this helper inline function available for all platforms. This helps solve 0-day compilation issues when CONFIG_SND_DMA_SGBUF is not defined. Reported-by: kbuild test robot Signed-off-by: Pierre-Louis Bossart Reviewed-by: Takashi Iwai Signed-off-by: Mark Brown --- diff --git a/include/sound/memalloc.h b/include/sound/memalloc.h index 9c3db3dce32b..c669900e6cbe 100644 --- a/include/sound/memalloc.h +++ b/include/sound/memalloc.h @@ -67,6 +67,14 @@ struct snd_dma_buffer { void *private_data; /* private for allocator; don't touch */ }; +/* + * return the pages matching with the given byte size + */ +static inline unsigned int snd_sgbuf_aligned_pages(size_t size) +{ + return (size + PAGE_SIZE - 1) >> PAGE_SHIFT; +} + #ifdef CONFIG_SND_DMA_SGBUF /* * Scatter-Gather generic device pages @@ -90,14 +98,6 @@ struct snd_sg_buf { struct device *dev; }; -/* - * return the pages matching with the given byte size - */ -static inline unsigned int snd_sgbuf_aligned_pages(size_t size) -{ - return (size + PAGE_SIZE - 1) >> PAGE_SHIFT; -} - /* * return the physical address at the corresponding offset */