X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=sound%2Fcore%2Fioctl32%2Fioctl32.h;h=39887cc3b04b8b1a01b9630f5fe03f6c71e3c055;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=e59d382102fff8306a413a4091c10caef8f4a11e;hpb=db216c3d5e4c040e557a50f8f5d35d5c415e8c1c;p=linux-2.6.git diff --git a/sound/core/ioctl32/ioctl32.h b/sound/core/ioctl32/ioctl32.h index e59d38210..39887cc3b 100644 --- a/sound/core/ioctl32/ioctl32.h +++ b/sound/core/ioctl32/ioctl32.h @@ -26,19 +26,10 @@ #ifndef __ALSA_IOCTL32_H #define __ALSA_IOCTL32_H -#ifndef A -#ifdef CONFIG_PPC64 -#include -#else -/* x86-64, sparc64 */ -#define A(__x) ((void *)(unsigned long)(__x)) -#endif -#endif - -#define TO_PTR(x) A(x) +#include #define COPY(x) (dst->x = src->x) -#define CPTR(x) (dst->x = (typeof(dst->x))A(src->x)) +#define CPTR(x) (dst->x = compat_ptr(src->x)) #define convert_from_32(type, dstp, srcp)\ {\ @@ -62,7 +53,7 @@ static int _snd_ioctl32_##type(unsigned int fd, unsigned int cmd, unsigned long struct sndrv_##type data;\ mm_segment_t oldseg;\ int err;\ - if (copy_from_user(&data32, (void*)arg, sizeof(data32)))\ + if (copy_from_user(&data32, (void __user *)arg, sizeof(data32)))\ return -EFAULT;\ memset(&data, 0, sizeof(data));\ convert_from_32(type, &data, &data32);\ @@ -74,7 +65,7 @@ static int _snd_ioctl32_##type(unsigned int fd, unsigned int cmd, unsigned long return err;\ if (native_ctl & (_IOC_READ << _IOC_DIRSHIFT)) {\ convert_to_32(type, &data32, &data);\ - if (copy_to_user((void*)arg, &data32, sizeof(data32)))\ + if (copy_to_user((void __user *)arg, &data32, sizeof(data32)))\ return -EFAULT;\ }\ return 0;\ @@ -93,7 +84,7 @@ static int _snd_ioctl32_##type(unsigned int fd, unsigned int cmd, unsigned long err = -ENOMEM; \ goto __end; \ }\ - if (copy_from_user(data32, (void*)arg, sizeof(*data32))) { \ + if (copy_from_user(data32, (void __user *)arg, sizeof(*data32))) { \ err = -EFAULT; \ goto __end; \ }\ @@ -108,7 +99,7 @@ static int _snd_ioctl32_##type(unsigned int fd, unsigned int cmd, unsigned long err = 0;\ if (native_ctl & (_IOC_READ << _IOC_DIRSHIFT)) {\ convert_to_32(type, data32, data);\ - if (copy_to_user((void*)arg, data32, sizeof(*data32)))\ + if (copy_to_user((void __user *)arg, data32, sizeof(*data32)))\ err = -EFAULT;\ }\ __end:\