diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2006-01-12 04:06:26 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-12 12:09:03 -0500 |
commit | 1b7bb54a417ca73eefc52df3702ff5167b46dc89 (patch) | |
tree | d54252ef62ea1e140613d20a7cbf6f1efaf0aba2 /arch/m68k | |
parent | 2382f77ffcde32e5195d5c82fee91171bb764c1a (diff) |
[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>
Diffstat (limited to 'arch/m68k')
-rw-r--r-- | arch/m68k/bvme6000/rtc.c | 6 | ||||
-rw-r--r-- | arch/m68k/mvme16x/rtc.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/arch/m68k/bvme6000/rtc.c b/arch/m68k/bvme6000/rtc.c index f7573f2bcb9c..703cbc6dc9cc 100644 --- a/arch/m68k/bvme6000/rtc.c +++ b/arch/m68k/bvme6000/rtc.c | |||
@@ -47,6 +47,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
47 | unsigned char msr; | 47 | unsigned char msr; |
48 | unsigned long flags; | 48 | unsigned long flags; |
49 | struct rtc_time wtime; | 49 | struct rtc_time wtime; |
50 | void __user *argp = (void __user *)arg; | ||
50 | 51 | ||
51 | switch (cmd) { | 52 | switch (cmd) { |
52 | case RTC_RD_TIME: /* Read the time/date from RTC */ | 53 | case RTC_RD_TIME: /* Read the time/date from RTC */ |
@@ -69,7 +70,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
69 | } while (wtime.tm_sec != BCD2BIN(rtc->bcd_sec)); | 70 | } while (wtime.tm_sec != BCD2BIN(rtc->bcd_sec)); |
70 | rtc->msr = msr; | 71 | rtc->msr = msr; |
71 | local_irq_restore(flags); | 72 | local_irq_restore(flags); |
72 | return copy_to_user((void *)arg, &wtime, sizeof wtime) ? | 73 | return copy_to_user(argp, &wtime, sizeof wtime) ? |
73 | -EFAULT : 0; | 74 | -EFAULT : 0; |
74 | } | 75 | } |
75 | case RTC_SET_TIME: /* Set the RTC */ | 76 | case RTC_SET_TIME: /* Set the RTC */ |
@@ -81,8 +82,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
81 | if (!capable(CAP_SYS_ADMIN)) | 82 | if (!capable(CAP_SYS_ADMIN)) |
82 | return -EACCES; | 83 | return -EACCES; |
83 | 84 | ||
84 | if (copy_from_user(&rtc_tm, (struct rtc_time*)arg, | 85 | if (copy_from_user(&rtc_tm, argp, sizeof(struct rtc_time))) |
85 | sizeof(struct rtc_time))) | ||
86 | return -EFAULT; | 86 | return -EFAULT; |
87 | 87 | ||
88 | yrs = rtc_tm.tm_year; | 88 | yrs = rtc_tm.tm_year; |
diff --git a/arch/m68k/mvme16x/rtc.c b/arch/m68k/mvme16x/rtc.c index 30f5921ece9b..a69fe3048edc 100644 --- a/arch/m68k/mvme16x/rtc.c +++ b/arch/m68k/mvme16x/rtc.c | |||
@@ -45,6 +45,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
45 | volatile MK48T08ptr_t rtc = (MK48T08ptr_t)MVME_RTC_BASE; | 45 | volatile MK48T08ptr_t rtc = (MK48T08ptr_t)MVME_RTC_BASE; |
46 | unsigned long flags; | 46 | unsigned long flags; |
47 | struct rtc_time wtime; | 47 | struct rtc_time wtime; |
48 | void __user *argp = (void __user *)arg; | ||
48 | 49 | ||
49 | switch (cmd) { | 50 | switch (cmd) { |
50 | case RTC_RD_TIME: /* Read the time/date from RTC */ | 51 | case RTC_RD_TIME: /* Read the time/date from RTC */ |
@@ -64,7 +65,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
64 | wtime.tm_wday = BCD2BIN(rtc->bcd_dow)-1; | 65 | wtime.tm_wday = BCD2BIN(rtc->bcd_dow)-1; |
65 | rtc->ctrl = 0; | 66 | rtc->ctrl = 0; |
66 | local_irq_restore(flags); | 67 | local_irq_restore(flags); |
67 | return copy_to_user((void *)arg, &wtime, sizeof wtime) ? | 68 | return copy_to_user(argp, &wtime, sizeof wtime) ? |
68 | -EFAULT : 0; | 69 | -EFAULT : 0; |
69 | } | 70 | } |
70 | case RTC_SET_TIME: /* Set the RTC */ | 71 | case RTC_SET_TIME: /* Set the RTC */ |
@@ -76,8 +77,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
76 | if (!capable(CAP_SYS_ADMIN)) | 77 | if (!capable(CAP_SYS_ADMIN)) |
77 | return -EACCES; | 78 | return -EACCES; |
78 | 79 | ||
79 | if (copy_from_user(&rtc_tm, (struct rtc_time*)arg, | 80 | if (copy_from_user(&rtc_tm, argp, sizeof(struct rtc_time))) |
80 | sizeof(struct rtc_time))) | ||
81 | return -EFAULT; | 81 | return -EFAULT; |
82 | 82 | ||
83 | yrs = rtc_tm.tm_year; | 83 | yrs = rtc_tm.tm_year; |