From: Al Viro Signed-off-by: Al Viro Cc: Roman Zippel Signed-off-by: Andrew Morton --- arch/m68k/bvme6000/rtc.c | 6 +++--- arch/m68k/mvme16x/rtc.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff -puN arch/m68k/bvme6000/rtc.c~m68k-rtc-__user-annotations arch/m68k/bvme6000/rtc.c --- devel/arch/m68k/bvme6000/rtc.c~m68k-rtc-__user-annotations 2006-01-04 22:24:27.000000000 -0800 +++ devel-akpm/arch/m68k/bvme6000/rtc.c 2006-01-04 22:24:27.000000000 -0800 @@ -46,6 +46,7 @@ static int rtc_ioctl(struct inode *inode 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 */ @@ -68,7 +69,7 @@ static int rtc_ioctl(struct inode *inode } 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 */ @@ -80,8 +81,7 @@ static int rtc_ioctl(struct inode *inode 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; diff -puN arch/m68k/mvme16x/rtc.c~m68k-rtc-__user-annotations arch/m68k/mvme16x/rtc.c --- devel/arch/m68k/mvme16x/rtc.c~m68k-rtc-__user-annotations 2006-01-04 22:24:27.000000000 -0800 +++ devel-akpm/arch/m68k/mvme16x/rtc.c 2006-01-04 22:24:27.000000000 -0800 @@ -44,6 +44,7 @@ static int rtc_ioctl(struct inode *inode 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 */ @@ -63,7 +64,7 @@ static int rtc_ioctl(struct inode *inode 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 */ @@ -75,8 +76,7 @@ static int rtc_ioctl(struct inode *inode 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; _