summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2016-01-25 07:59:21 -0500
committerTakashi Iwai <tiwai@suse.de>2016-01-25 14:27:33 -0500
commit462b3f161beb62eeb290f4ec52f5ead29a2f8ac7 (patch)
tree21772e19c3f1e46cd067daeb7b5a1bcea4b1802e /sound
parentda10816e3d923565b470fec78a674baba794ed33 (diff)
ALSA: compress: Disable GET_CODEC_CAPS ioctl for some architectures
Some architectures like PowerPC can handle the maximum struct size in an ioctl only up to 13 bits, and struct snd_compr_codec_caps used by SNDRV_COMPRESS_GET_CODEC_CAPS ioctl overflows this limit. This problem was revealed recently by a powerpc change, as it's now treated as a fatal build error. This patch is a stop-gap for that: for architectures with less than 14 bit ioctl struct size, get rid of the handling of the relevant ioctl. We should provide an alternative equivalent ioctl code later, but for now just paper over it. Luckily, the compress API hasn't been used on such architectures, so the impact must be effectively zero. Reviewed-by: Mark Brown <broonie@kernel.org> Acked-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/core/compress_offload.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
index 18b8dc45bb8f..7fac3cae8abd 100644
--- a/sound/core/compress_offload.c
+++ b/sound/core/compress_offload.c
@@ -46,6 +46,13 @@
46#include <sound/compress_offload.h> 46#include <sound/compress_offload.h>
47#include <sound/compress_driver.h> 47#include <sound/compress_driver.h>
48 48
49/* struct snd_compr_codec_caps overflows the ioctl bit size for some
50 * architectures, so we need to disable the relevant ioctls.
51 */
52#if _IOC_SIZEBITS < 14
53#define COMPR_CODEC_CAPS_OVERFLOW
54#endif
55
49/* TODO: 56/* TODO:
50 * - add substream support for multiple devices in case of 57 * - add substream support for multiple devices in case of
51 * SND_DYNAMIC_MINORS is not used 58 * SND_DYNAMIC_MINORS is not used
@@ -440,6 +447,7 @@ out:
440 return retval; 447 return retval;
441} 448}
442 449
450#ifndef COMPR_CODEC_CAPS_OVERFLOW
443static int 451static int
444snd_compr_get_codec_caps(struct snd_compr_stream *stream, unsigned long arg) 452snd_compr_get_codec_caps(struct snd_compr_stream *stream, unsigned long arg)
445{ 453{
@@ -463,6 +471,7 @@ out:
463 kfree(caps); 471 kfree(caps);
464 return retval; 472 return retval;
465} 473}
474#endif /* !COMPR_CODEC_CAPS_OVERFLOW */
466 475
467/* revisit this with snd_pcm_preallocate_xxx */ 476/* revisit this with snd_pcm_preallocate_xxx */
468static int snd_compr_allocate_buffer(struct snd_compr_stream *stream, 477static int snd_compr_allocate_buffer(struct snd_compr_stream *stream,
@@ -801,9 +810,11 @@ static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
801 case _IOC_NR(SNDRV_COMPRESS_GET_CAPS): 810 case _IOC_NR(SNDRV_COMPRESS_GET_CAPS):
802 retval = snd_compr_get_caps(stream, arg); 811 retval = snd_compr_get_caps(stream, arg);
803 break; 812 break;
813#ifndef COMPR_CODEC_CAPS_OVERFLOW
804 case _IOC_NR(SNDRV_COMPRESS_GET_CODEC_CAPS): 814 case _IOC_NR(SNDRV_COMPRESS_GET_CODEC_CAPS):
805 retval = snd_compr_get_codec_caps(stream, arg); 815 retval = snd_compr_get_codec_caps(stream, arg);
806 break; 816 break;
817#endif
807 case _IOC_NR(SNDRV_COMPRESS_SET_PARAMS): 818 case _IOC_NR(SNDRV_COMPRESS_SET_PARAMS):
808 retval = snd_compr_set_params(stream, arg); 819 retval = snd_compr_set_params(stream, arg);
809 break; 820 break;