Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 18122
b: refs/heads/master
c: 1b7bb54
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro authored and Linus Torvalds committed Jan 12, 2006
1 parent af20faa commit 0225e26
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2382f77ffcde32e5195d5c82fee91171bb764c1a
refs/heads/master: 1b7bb54a417ca73eefc52df3702ff5167b46dc89
6 changes: 3 additions & 3 deletions trunk/arch/m68k/bvme6000/rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned char msr;
unsigned long flags;
struct rtc_time wtime;
void __user *argp = (void __user *)arg;

switch (cmd) {
case RTC_RD_TIME: /* Read the time/date from RTC */
Expand All @@ -69,7 +70,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
} while (wtime.tm_sec != BCD2BIN(rtc->bcd_sec));
rtc->msr = msr;
local_irq_restore(flags);
return copy_to_user((void *)arg, &wtime, sizeof wtime) ?
return copy_to_user(argp, &wtime, sizeof wtime) ?
-EFAULT : 0;
}
case RTC_SET_TIME: /* Set the RTC */
Expand All @@ -81,8 +82,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
if (!capable(CAP_SYS_ADMIN))
return -EACCES;

if (copy_from_user(&rtc_tm, (struct rtc_time*)arg,
sizeof(struct rtc_time)))
if (copy_from_user(&rtc_tm, argp, sizeof(struct rtc_time)))
return -EFAULT;

yrs = rtc_tm.tm_year;
Expand Down
6 changes: 3 additions & 3 deletions trunk/arch/m68k/mvme16x/rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
volatile MK48T08ptr_t rtc = (MK48T08ptr_t)MVME_RTC_BASE;
unsigned long flags;
struct rtc_time wtime;
void __user *argp = (void __user *)arg;

switch (cmd) {
case RTC_RD_TIME: /* Read the time/date from RTC */
Expand All @@ -64,7 +65,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
wtime.tm_wday = BCD2BIN(rtc->bcd_dow)-1;
rtc->ctrl = 0;
local_irq_restore(flags);
return copy_to_user((void *)arg, &wtime, sizeof wtime) ?
return copy_to_user(argp, &wtime, sizeof wtime) ?
-EFAULT : 0;
}
case RTC_SET_TIME: /* Set the RTC */
Expand All @@ -76,8 +77,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
if (!capable(CAP_SYS_ADMIN))
return -EACCES;

if (copy_from_user(&rtc_tm, (struct rtc_time*)arg,
sizeof(struct rtc_time)))
if (copy_from_user(&rtc_tm, argp, sizeof(struct rtc_time)))
return -EFAULT;

yrs = rtc_tm.tm_year;
Expand Down

0 comments on commit 0225e26

Please sign in to comment.