Skip to content

Commit

Permalink
ALSA: memalloc: declare snd_sgbuf_aligned_pages() unconditionally
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pierre-Louis Bossart authored and Mark Brown committed Jul 26, 2018
1 parent ce397d2 commit 4cae99d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions include/sound/memalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
*/
Expand Down

0 comments on commit 4cae99d

Please sign in to comment.