diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2005-09-28 19:42:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-29 11:46:27 -0400 |
commit | b2846dfa4aa1bbbf3f9977d67566952d7f621009 (patch) | |
tree | 5c58a8e6dc823daa49b41d4c3e802915454a4788 | |
parent | ae8aed0314064da3002879fedc2d262c72865a17 (diff) |
[PATCH] mv64x60_wdt __user annotations and cleanups
- use nonseekable_open() instead of messing with
if (*ppos != file->f_pos)
return -EISPIPE
in ->write() (->read is NULL).
- trivial __user annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | drivers/char/watchdog/mv64x60_wdt.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/char/watchdog/mv64x60_wdt.c b/drivers/char/watchdog/mv64x60_wdt.c index 1436aea3b28f..6d3ff0836c44 100644 --- a/drivers/char/watchdog/mv64x60_wdt.c +++ b/drivers/char/watchdog/mv64x60_wdt.c | |||
@@ -87,6 +87,8 @@ static int mv64x60_wdt_open(struct inode *inode, struct file *file) | |||
87 | mv64x60_wdt_service(); | 87 | mv64x60_wdt_service(); |
88 | mv64x60_wdt_handler_enable(); | 88 | mv64x60_wdt_handler_enable(); |
89 | 89 | ||
90 | nonseekable_open(inode, file); | ||
91 | |||
90 | return 0; | 92 | return 0; |
91 | } | 93 | } |
92 | 94 | ||
@@ -103,12 +105,9 @@ static int mv64x60_wdt_release(struct inode *inode, struct file *file) | |||
103 | return 0; | 105 | return 0; |
104 | } | 106 | } |
105 | 107 | ||
106 | static ssize_t mv64x60_wdt_write(struct file *file, const char *data, | 108 | static ssize_t mv64x60_wdt_write(struct file *file, const char __user *data, |
107 | size_t len, loff_t * ppos) | 109 | size_t len, loff_t * ppos) |
108 | { | 110 | { |
109 | if (*ppos != file->f_pos) | ||
110 | return -ESPIPE; | ||
111 | |||
112 | if (len) | 111 | if (len) |
113 | mv64x60_wdt_service(); | 112 | mv64x60_wdt_service(); |
114 | 113 | ||
@@ -119,6 +118,7 @@ static int mv64x60_wdt_ioctl(struct inode *inode, struct file *file, | |||
119 | unsigned int cmd, unsigned long arg) | 118 | unsigned int cmd, unsigned long arg) |
120 | { | 119 | { |
121 | int timeout; | 120 | int timeout; |
121 | void __user *argp = (void __user *)arg; | ||
122 | static struct watchdog_info info = { | 122 | static struct watchdog_info info = { |
123 | .options = WDIOF_KEEPALIVEPING, | 123 | .options = WDIOF_KEEPALIVEPING, |
124 | .firmware_version = 0, | 124 | .firmware_version = 0, |
@@ -127,13 +127,13 @@ static int mv64x60_wdt_ioctl(struct inode *inode, struct file *file, | |||
127 | 127 | ||
128 | switch (cmd) { | 128 | switch (cmd) { |
129 | case WDIOC_GETSUPPORT: | 129 | case WDIOC_GETSUPPORT: |
130 | if (copy_to_user((void *)arg, &info, sizeof(info))) | 130 | if (copy_to_user(argp, &info, sizeof(info))) |
131 | return -EFAULT; | 131 | return -EFAULT; |
132 | break; | 132 | break; |
133 | 133 | ||
134 | case WDIOC_GETSTATUS: | 134 | case WDIOC_GETSTATUS: |
135 | case WDIOC_GETBOOTSTATUS: | 135 | case WDIOC_GETBOOTSTATUS: |
136 | if (put_user(wdt_status, (int *)arg)) | 136 | if (put_user(wdt_status, (int __user *)argp)) |
137 | return -EFAULT; | 137 | return -EFAULT; |
138 | wdt_status &= ~WDIOF_KEEPALIVEPING; | 138 | wdt_status &= ~WDIOF_KEEPALIVEPING; |
139 | break; | 139 | break; |
@@ -154,7 +154,7 @@ static int mv64x60_wdt_ioctl(struct inode *inode, struct file *file, | |||
154 | 154 | ||
155 | case WDIOC_GETTIMEOUT: | 155 | case WDIOC_GETTIMEOUT: |
156 | timeout = mv64x60_wdt_timeout * HZ; | 156 | timeout = mv64x60_wdt_timeout * HZ; |
157 | if (put_user(timeout, (int *)arg)) | 157 | if (put_user(timeout, (int __user *)argp)) |
158 | return -EFAULT; | 158 | return -EFAULT; |
159 | break; | 159 | break; |
160 | 160 | ||