[PATCH] m68k: rtc __user annotations

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Al Viro and committed by Linus Torvalds 1b7bb54a 2382f77f

+6 -6
+3 -3
arch/m68k/bvme6000/rtc.c
··· 47 unsigned char msr; 48 unsigned long flags; 49 struct rtc_time wtime; 50 51 switch (cmd) { 52 case RTC_RD_TIME: /* Read the time/date from RTC */ ··· 70 } while (wtime.tm_sec != BCD2BIN(rtc->bcd_sec)); 71 rtc->msr = msr; 72 local_irq_restore(flags); 73 - return copy_to_user((void *)arg, &wtime, sizeof wtime) ? 74 -EFAULT : 0; 75 } 76 case RTC_SET_TIME: /* Set the RTC */ ··· 82 if (!capable(CAP_SYS_ADMIN)) 83 return -EACCES; 84 85 - if (copy_from_user(&rtc_tm, (struct rtc_time*)arg, 86 - sizeof(struct rtc_time))) 87 return -EFAULT; 88 89 yrs = rtc_tm.tm_year;
··· 47 unsigned char msr; 48 unsigned long flags; 49 struct rtc_time wtime; 50 + void __user *argp = (void __user *)arg; 51 52 switch (cmd) { 53 case RTC_RD_TIME: /* Read the time/date from RTC */ ··· 69 } while (wtime.tm_sec != BCD2BIN(rtc->bcd_sec)); 70 rtc->msr = msr; 71 local_irq_restore(flags); 72 + return copy_to_user(argp, &wtime, sizeof wtime) ? 73 -EFAULT : 0; 74 } 75 case RTC_SET_TIME: /* Set the RTC */ ··· 81 if (!capable(CAP_SYS_ADMIN)) 82 return -EACCES; 83 84 + if (copy_from_user(&rtc_tm, argp, sizeof(struct rtc_time))) 85 return -EFAULT; 86 87 yrs = rtc_tm.tm_year;
+3 -3
arch/m68k/mvme16x/rtc.c
··· 45 volatile MK48T08ptr_t rtc = (MK48T08ptr_t)MVME_RTC_BASE; 46 unsigned long flags; 47 struct rtc_time wtime; 48 49 switch (cmd) { 50 case RTC_RD_TIME: /* Read the time/date from RTC */ ··· 65 wtime.tm_wday = BCD2BIN(rtc->bcd_dow)-1; 66 rtc->ctrl = 0; 67 local_irq_restore(flags); 68 - return copy_to_user((void *)arg, &wtime, sizeof wtime) ? 69 -EFAULT : 0; 70 } 71 case RTC_SET_TIME: /* Set the RTC */ ··· 77 if (!capable(CAP_SYS_ADMIN)) 78 return -EACCES; 79 80 - if (copy_from_user(&rtc_tm, (struct rtc_time*)arg, 81 - sizeof(struct rtc_time))) 82 return -EFAULT; 83 84 yrs = rtc_tm.tm_year;
··· 45 volatile MK48T08ptr_t rtc = (MK48T08ptr_t)MVME_RTC_BASE; 46 unsigned long flags; 47 struct rtc_time wtime; 48 + void __user *argp = (void __user *)arg; 49 50 switch (cmd) { 51 case RTC_RD_TIME: /* Read the time/date from RTC */ ··· 64 wtime.tm_wday = BCD2BIN(rtc->bcd_dow)-1; 65 rtc->ctrl = 0; 66 local_irq_restore(flags); 67 + return copy_to_user(argp, &wtime, sizeof wtime) ? 68 -EFAULT : 0; 69 } 70 case RTC_SET_TIME: /* Set the RTC */ ··· 76 if (!capable(CAP_SYS_ADMIN)) 77 return -EACCES; 78 79 + if (copy_from_user(&rtc_tm, argp, sizeof(struct rtc_time))) 80 return -EFAULT; 81 82 yrs = rtc_tm.tm_year;