diff options
author | Ben Dooks <ben-linux@fluff.org> | 2008-09-16 06:31:01 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2008-09-23 04:06:57 -0400 |
commit | edf86c9b98b5162bed64a70f9424bd2dd58a717e (patch) | |
tree | a22adacfc23fd6711dca4e7dfa58c721227e1c87 /drivers/watchdog | |
parent | 7f605ac00416d763c2d9681e378a75e7adbb06e8 (diff) |
[WATCHDOG] wdt285: fix sparse warnings
The wdt285.c watchdog driver is producing a number of
sparse errors due to missing __user attributes to calls
to put_user and copy_to_user, as well as in the prototype
of watchdog_write.
wdt285.c:144:21: warning: incorrect type in argument 1 (different address spaces)
wdt285.c:144:21: expected void [noderef] <asn:1>*to
wdt285.c:144:21: got void *<noident>
wdt285.c:150:9: warning: incorrect type in initializer (different address spaces)
wdt285.c:150:9: expected int const [noderef] <asn:1>*register __p
wdt285.c:150:9: got int *<noident>
wdt285.c:159:9: warning: incorrect type in initializer (different address spaces)
wdt285.c:159:9: expected int const [noderef] <asn:1>*register __p
wdt285.c:159:9: got int *<noident>
wdt285.c:174:9: warning: incorrect type in initializer (different address spaces)
wdt285.c:174:9: expected int const [noderef] <asn:1>*register __p
wdt285.c:174:9: got int *<noident>
wdt285.c:183:12: warning: incorrect type in initializer (incompatible argument 2 (different address spaces))
wdt285.c:183:12: expected int ( *write )( ... )
wdt285.c:183:12: got int ( static [toplevel] *<noident> )( ... )
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | drivers/watchdog/wdt285.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/watchdog/wdt285.c b/drivers/watchdog/wdt285.c index db362c34958b..191ea6302107 100644 --- a/drivers/watchdog/wdt285.c +++ b/drivers/watchdog/wdt285.c | |||
@@ -115,8 +115,8 @@ static int watchdog_release(struct inode *inode, struct file *file) | |||
115 | return 0; | 115 | return 0; |
116 | } | 116 | } |
117 | 117 | ||
118 | static ssize_t watchdog_write(struct file *file, const char *data, | 118 | static ssize_t watchdog_write(struct file *file, const char __user *data, |
119 | size_t len, loff_t *ppos) | 119 | size_t len, loff_t *ppos) |
120 | { | 120 | { |
121 | /* | 121 | /* |
122 | * Refresh the timer. | 122 | * Refresh the timer. |
@@ -133,21 +133,22 @@ static const struct watchdog_info ident = { | |||
133 | }; | 133 | }; |
134 | 134 | ||
135 | static long watchdog_ioctl(struct file *file, unsigned int cmd, | 135 | static long watchdog_ioctl(struct file *file, unsigned int cmd, |
136 | unsigned long arg) | 136 | unsigned long arg) |
137 | { | 137 | { |
138 | unsigned int new_margin; | 138 | unsigned int new_margin; |
139 | int __user *int_arg = (int __user *)arg; | ||
139 | int ret = -ENOTTY; | 140 | int ret = -ENOTTY; |
140 | 141 | ||
141 | switch (cmd) { | 142 | switch (cmd) { |
142 | case WDIOC_GETSUPPORT: | 143 | case WDIOC_GETSUPPORT: |
143 | ret = 0; | 144 | ret = 0; |
144 | if (copy_to_user((void *)arg, &ident, sizeof(ident))) | 145 | if (copy_to_user((void __user *)arg, &ident, sizeof(ident))) |
145 | ret = -EFAULT; | 146 | ret = -EFAULT; |
146 | break; | 147 | break; |
147 | 148 | ||
148 | case WDIOC_GETSTATUS: | 149 | case WDIOC_GETSTATUS: |
149 | case WDIOC_GETBOOTSTATUS: | 150 | case WDIOC_GETBOOTSTATUS: |
150 | ret = put_user(0, (int *)arg); | 151 | ret = put_user(0, int_arg); |
151 | break; | 152 | break; |
152 | 153 | ||
153 | case WDIOC_KEEPALIVE: | 154 | case WDIOC_KEEPALIVE: |
@@ -156,7 +157,7 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd, | |||
156 | break; | 157 | break; |
157 | 158 | ||
158 | case WDIOC_SETTIMEOUT: | 159 | case WDIOC_SETTIMEOUT: |
159 | ret = get_user(new_margin, (int *)arg); | 160 | ret = get_user(new_margin, int_arg); |
160 | if (ret) | 161 | if (ret) |
161 | break; | 162 | break; |
162 | 163 | ||
@@ -171,7 +172,7 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd, | |||
171 | watchdog_ping(); | 172 | watchdog_ping(); |
172 | /* Fall */ | 173 | /* Fall */ |
173 | case WDIOC_GETTIMEOUT: | 174 | case WDIOC_GETTIMEOUT: |
174 | ret = put_user(soft_margin, (int *)arg); | 175 | ret = put_user(soft_margin, int_arg); |
175 | break; | 176 | break; |
176 | } | 177 | } |
177 | return ret; | 178 | return ret; |