Skip to content

Commit

Permalink
[PATCH] x86_64: Fix ioctl compat code for /dev/rtc
Browse files Browse the repository at this point in the history
RTC_IRQP_SET/RTC_EPOCH_SET don't take a pointer to an argument, but the
argument itself.  This actually simplifies the code and makes it work.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed Feb 26, 2006
1 parent ab9b32e commit fc5870f
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions fs/compat_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2531,18 +2531,9 @@ static int rtc_ioctl(unsigned fd, unsigned cmd, unsigned long arg)
val32 = kval;
return put_user(val32, (unsigned int __user *)arg);
case RTC_IRQP_SET32:
return sys_ioctl(fd, RTC_IRQP_SET, arg);
case RTC_EPOCH_SET32:
ret = get_user(val32, (unsigned int __user *)arg);
if (ret)
return ret;
kval = val32;

set_fs(KERNEL_DS);
ret = sys_ioctl(fd, (cmd == RTC_IRQP_SET32) ?
RTC_IRQP_SET : RTC_EPOCH_SET,
(unsigned long)&kval);
set_fs(oldfs);
return ret;
return sys_ioctl(fd, RTC_EPOCH_SET, arg);
default:
/* unreached */
return -ENOIOCTLCMD;
Expand Down

0 comments on commit fc5870f

Please sign in to comment.