compat_ioctl: move CDROMREADADIO to cdrom.c
Again, there is only one file that needs this, so move the conversion handler into the native implementation. Reviewed-by: Ben Hutchings <ben.hutchings@codethink.co.uk> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
@@ -3017,9 +3017,31 @@ static noinline int mmc_ioctl_cdrom_read_audio(struct cdrom_device_info *cdi,
|
||||
struct cdrom_read_audio ra;
|
||||
int lba;
|
||||
|
||||
if (copy_from_user(&ra, (struct cdrom_read_audio __user *)arg,
|
||||
sizeof(ra)))
|
||||
return -EFAULT;
|
||||
#ifdef CONFIG_COMPAT
|
||||
if (in_compat_syscall()) {
|
||||
struct compat_cdrom_read_audio {
|
||||
union cdrom_addr addr;
|
||||
u8 addr_format;
|
||||
compat_int_t nframes;
|
||||
compat_caddr_t buf;
|
||||
} ra32;
|
||||
|
||||
if (copy_from_user(&ra32, arg, sizeof(ra32)))
|
||||
return -EFAULT;
|
||||
|
||||
ra = (struct cdrom_read_audio) {
|
||||
.addr = ra32.addr,
|
||||
.addr_format = ra32.addr_format,
|
||||
.nframes = ra32.nframes,
|
||||
.buf = compat_ptr(ra32.buf),
|
||||
};
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
if (copy_from_user(&ra, (struct cdrom_read_audio __user *)arg,
|
||||
sizeof(ra)))
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
if (ra.addr_format == CDROM_MSF)
|
||||
lba = msf_to_lba(ra.addr.msf.minute,
|
||||
|
Reference in New Issue
Block a user