Skip to content

Commit 4cae99d

Browse files
plbossartbroonie
authored andcommitted
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 <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>
1 parent ce397d2 commit 4cae99d

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎include/sound/memalloc.h‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ struct snd_dma_buffer {
6767
void *private_data; /* private for allocator; don't touch */
6868
};
6969

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+
7078
#ifdef CONFIG_SND_DMA_SGBUF
7179
/*
7280
* Scatter-Gather generic device pages
@@ -90,14 +98,6 @@ struct snd_sg_buf {
9098
struct device *dev;
9199
};
92100

93-
/*
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-
101101
/*
102102
* return the physical address at the corresponding offset
103103
*/

0 commit comments

Comments
 (0)