summaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorRavindra Lokhande <rlokhande@nvidia.com>2015-12-07 12:08:31 +0530
committerTakashi Iwai <tiwai@suse.de>2015-12-07 10:44:48 +0100
commitc10368897e104c008c610915a218f0fe5fa4ec96 (patch)
tree4a773f590602c8b4fc63d3db5420062cf392ca66 /sound/core
parent6603249dcdbb6aab0b726bdf372d6f20c0d2d611 (diff)
downloadop-kernel-dev-c10368897e104c008c610915a218f0fe5fa4ec96.zip
op-kernel-dev-c10368897e104c008c610915a218f0fe5fa4ec96.tar.gz
ALSA: compress: add support for 32bit calls in a 64bit kernel
Compress offload does not support ioctl calls from a 32bit userspace in a 64 bit kernel. This patch adds support for ioctls from a 32bit userspace in a 64bit kernel Signed-off-by: Ravindra Lokhande <rlokhande@nvidia.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/compress_offload.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
index 2c52510..18b8dc4 100644
--- a/sound/core/compress_offload.c
+++ b/sound/core/compress_offload.c
@@ -38,6 +38,7 @@
#include <linux/uio.h>
#include <linux/uaccess.h>
#include <linux/module.h>
+#include <linux/compat.h>
#include <sound/core.h>
#include <sound/initval.h>
#include <sound/info.h>
@@ -848,6 +849,15 @@ static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
return retval;
}
+/* support of 32bit userspace on 64bit platforms */
+#ifdef CONFIG_COMPAT
+static long snd_compr_ioctl_compat(struct file *file, unsigned int cmd,
+ unsigned long arg)
+{
+ return snd_compr_ioctl(file, cmd, (unsigned long)compat_ptr(arg));
+}
+#endif
+
static const struct file_operations snd_compr_file_ops = {
.owner = THIS_MODULE,
.open = snd_compr_open,
@@ -855,6 +865,9 @@ static const struct file_operations snd_compr_file_ops = {
.write = snd_compr_write,
.read = snd_compr_read,
.unlocked_ioctl = snd_compr_ioctl,
+#ifdef CONFIG_COMPAT
+ .compat_ioctl = snd_compr_ioctl_compat,
+#endif
.mmap = snd_compr_mmap,
.poll = snd_compr_poll,
};
OpenPOWER on IntegriCloud