m68k: rtc __user annotations
PATCH 24/36 m68k: rtc __user annotations
From: Al Viro <[email protected]>
Date: 1135011480 -0500
Signed-off-by Al Viro <[email protected]>
---
arch/m68k/bvme6000/rtc.c | 6 +++--- arch/m68k/mvme16x/rtc.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)
b8476525cbcf02835f83ab0e2ca58e7b00746ff9
arch/m68k/bvme6000/rtc.c +3 -3
@@ -46,6 +46,7 @@ static int rtc_ioctl(struct inode *inodeunsigned 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 *inodeif (!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;
arch/m68k/mvme16x/rtc.c +3 -3
@@ -44,6 +44,7 @@ static int rtc_ioctl(struct inode *inodevolatile 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 *inodeif (!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;
Signature · 1 line
0.99.9.GIT