Commit c25c7712 authored by Linus Torvalds's avatar Linus Torvalds

ppc64: add user annotations to rtc driver

parent dc5c7245
...@@ -56,7 +56,7 @@ extern int piranha_simulator; ...@@ -56,7 +56,7 @@ extern int piranha_simulator;
* ioctls. * ioctls.
*/ */
static ssize_t rtc_read(struct file *file, char *buf, static ssize_t rtc_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos); size_t count, loff_t *ppos);
static int rtc_ioctl(struct inode *inode, struct file *file, static int rtc_ioctl(struct inode *inode, struct file *file,
...@@ -79,7 +79,7 @@ static const unsigned char days_in_mo[] = ...@@ -79,7 +79,7 @@ static const unsigned char days_in_mo[] =
* Now all the various file operations that we export. * Now all the various file operations that we export.
*/ */
static ssize_t rtc_read(struct file *file, char *buf, static ssize_t rtc_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
return -EIO; return -EIO;
...@@ -106,7 +106,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -106,7 +106,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
if (!capable(CAP_SYS_TIME)) if (!capable(CAP_SYS_TIME))
return -EACCES; return -EACCES;
if (copy_from_user(&rtc_tm, (struct rtc_time*)arg, if (copy_from_user(&rtc_tm, (struct rtc_time __user *)arg,
sizeof(struct rtc_time))) sizeof(struct rtc_time)))
return -EFAULT; return -EFAULT;
...@@ -140,7 +140,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -140,7 +140,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
} }
case RTC_EPOCH_READ: /* Read the epoch. */ case RTC_EPOCH_READ: /* Read the epoch. */
{ {
return put_user (epoch, (unsigned long *)arg); return put_user (epoch, (unsigned long __user *)arg);
} }
case RTC_EPOCH_SET: /* Set the epoch. */ case RTC_EPOCH_SET: /* Set the epoch. */
{ {
...@@ -159,7 +159,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -159,7 +159,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
default: default:
return -EINVAL; return -EINVAL;
} }
return copy_to_user((void *)arg, &wtime, sizeof wtime) ? -EFAULT : 0; return copy_to_user((void __user *)arg, &wtime, sizeof wtime) ? -EFAULT : 0;
} }
static int rtc_open(struct inode *inode, struct file *file) static int rtc_open(struct inode *inode, struct file *file)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment