diff options
| author | Mark Brown <broonie@kernel.org> | 2018-07-26 12:08:39 -0400 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2018-07-26 12:08:39 -0400 |
| commit | fd56361177a3c10133c272eb130e3c11f0bcd9a9 (patch) | |
| tree | ca430baef83c3b3dbe4d166b9eecc3d774028438 /include/sound | |
| parent | 3ba66feb59810e2ce616da0c4f1a5230c74768a8 (diff) | |
| parent | 4cae99d9b5305ab8cccc839fccceb81ec9e5abda (diff) | |
Merge tag 'alsa-add-snd-sgbuf-aligned-pages' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-4.19
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.
Diffstat (limited to 'include/sound')
| -rw-r--r-- | include/sound/memalloc.h | 16 |
1 files changed, 8 insertions, 8 deletions
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 { | |||
| 67 | void *private_data; /* private for allocator; don't touch */ | 67 | void *private_data; /* private for allocator; don't touch */ |
| 68 | }; | 68 | }; |
| 69 | 69 | ||
| 70 | /* | ||
| 71 | * return the pages matching with the given byte size | ||
| 72 | */ | ||
| 73 | static inline unsigned int snd_sgbuf_aligned_pages(size_t size) | ||
| 74 | { | ||
| 75 | return (size + PAGE_SIZE - 1) >> PAGE_SHIFT; | ||
| 76 | } | ||
| 77 | |||
| 70 | #ifdef CONFIG_SND_DMA_SGBUF | 78 | #ifdef CONFIG_SND_DMA_SGBUF |
| 71 | /* | 79 | /* |
| 72 | * Scatter-Gather generic device pages | 80 | * Scatter-Gather generic device pages |
| @@ -91,14 +99,6 @@ struct snd_sg_buf { | |||
| 91 | }; | 99 | }; |
| 92 | 100 | ||
| 93 | /* | 101 | /* |
| 94 | * return the pages matching with the given byte size | ||
| 95 | */ | ||
| 96 | static inline unsigned int snd_sgbuf_aligned_pages(size_t size) | ||
| 97 | { | ||
| 98 | return (size + PAGE_SIZE - 1) >> PAGE_SHIFT; | ||
| 99 | } | ||
| 100 | |||
| 101 | /* | ||
| 102 | * return the physical address at the corresponding offset | 102 | * return the physical address at the corresponding offset |
| 103 | */ | 103 | */ |
| 104 | static inline dma_addr_t snd_sgbuf_get_addr(struct snd_dma_buffer *dmab, | 104 | static inline dma_addr_t snd_sgbuf_get_addr(struct snd_dma_buffer *dmab, |
