diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-10-30 08:45:58 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-10-30 08:48:29 -0400 |
commit | f213d8f79a3928eaa2e2936f8ab40761aac04b95 (patch) | |
tree | 0b4ab6129e0fcb820aa960ef79bb813f834f9c7a /include/sound | |
parent | 12cddbd8696657ff405e054be48747b906731698 (diff) |
ALSA: pcm: Use static inline for snd_pcm_lib_alloc_vmalloc_buffer()
... instead of #if 0 hack. It's more straightforward and obvious.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/pcm.h | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index e862497f7556..5c3310d7d4b8 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -942,7 +942,6 @@ int _snd_pcm_lib_alloc_vmalloc_buffer(struct snd_pcm_substream *substream, | |||
942 | int snd_pcm_lib_free_vmalloc_buffer(struct snd_pcm_substream *substream); | 942 | int snd_pcm_lib_free_vmalloc_buffer(struct snd_pcm_substream *substream); |
943 | struct page *snd_pcm_lib_get_vmalloc_page(struct snd_pcm_substream *substream, | 943 | struct page *snd_pcm_lib_get_vmalloc_page(struct snd_pcm_substream *substream, |
944 | unsigned long offset); | 944 | unsigned long offset); |
945 | #if 0 /* for kernel-doc */ | ||
946 | /** | 945 | /** |
947 | * snd_pcm_lib_alloc_vmalloc_buffer - allocate virtual DMA buffer | 946 | * snd_pcm_lib_alloc_vmalloc_buffer - allocate virtual DMA buffer |
948 | * @substream: the substream to allocate the buffer to | 947 | * @substream: the substream to allocate the buffer to |
@@ -955,8 +954,13 @@ struct page *snd_pcm_lib_get_vmalloc_page(struct snd_pcm_substream *substream, | |||
955 | * Return: 1 if the buffer was changed, 0 if not changed, or a negative error | 954 | * Return: 1 if the buffer was changed, 0 if not changed, or a negative error |
956 | * code. | 955 | * code. |
957 | */ | 956 | */ |
958 | static int snd_pcm_lib_alloc_vmalloc_buffer | 957 | static inline int snd_pcm_lib_alloc_vmalloc_buffer |
959 | (struct snd_pcm_substream *substream, size_t size); | 958 | (struct snd_pcm_substream *substream, size_t size) |
959 | { | ||
960 | return _snd_pcm_lib_alloc_vmalloc_buffer(substream, size, | ||
961 | GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO); | ||
962 | } | ||
963 | |||
960 | /** | 964 | /** |
961 | * snd_pcm_lib_alloc_vmalloc_32_buffer - allocate 32-bit-addressable buffer | 965 | * snd_pcm_lib_alloc_vmalloc_32_buffer - allocate 32-bit-addressable buffer |
962 | * @substream: the substream to allocate the buffer to | 966 | * @substream: the substream to allocate the buffer to |
@@ -968,15 +972,12 @@ static int snd_pcm_lib_alloc_vmalloc_buffer | |||
968 | * Return: 1 if the buffer was changed, 0 if not changed, or a negative error | 972 | * Return: 1 if the buffer was changed, 0 if not changed, or a negative error |
969 | * code. | 973 | * code. |
970 | */ | 974 | */ |
971 | static int snd_pcm_lib_alloc_vmalloc_32_buffer | 975 | static inline int snd_pcm_lib_alloc_vmalloc_32_buffer |
972 | (struct snd_pcm_substream *substream, size_t size); | 976 | (struct snd_pcm_substream *substream, size_t size) |
973 | #endif | 977 | { |
974 | #define snd_pcm_lib_alloc_vmalloc_buffer(subs, size) \ | 978 | return _snd_pcm_lib_alloc_vmalloc_buffer(substream, size, |
975 | _snd_pcm_lib_alloc_vmalloc_buffer \ | 979 | GFP_KERNEL | GFP_DMA32 | __GFP_ZERO); |
976 | (subs, size, GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO) | 980 | } |
977 | #define snd_pcm_lib_alloc_vmalloc_32_buffer(subs, size) \ | ||
978 | _snd_pcm_lib_alloc_vmalloc_buffer \ | ||
979 | (subs, size, GFP_KERNEL | GFP_DMA32 | __GFP_ZERO) | ||
980 | 981 | ||
981 | #define snd_pcm_get_dma_buf(substream) ((substream)->runtime->dma_buffer_p) | 982 | #define snd_pcm_get_dma_buf(substream) ((substream)->runtime->dma_buffer_p) |
982 | 983 | ||