OSDN Git Service

ALSA: memalloc: declare snd_sgbuf_aligned_pages() unconditionally
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Wed, 25 Jul 2018 20:15:56 +0000 (15:15 -0500)
committerMark Brown <broonie@kernel.org>
Thu, 26 Jul 2018 16:05:29 +0000 (17:05 +0100)
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 <lkp@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/memalloc.h

index 9c3db3d..c669900 100644 (file)
@@ -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
@@ -91,14 +99,6 @@ struct snd_sg_buf {
 };
 
 /*
- * 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
  */
 static inline dma_addr_t snd_sgbuf_get_addr(struct snd_dma_buffer *dmab,