Commit 3bd1911b134ce4a669ea6cf531a36440753b0aaa

Authored by Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog

* git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog:
  [WATCHDOG] unlocked_ioctl changes
  [WATCHDOG] wdt285: fix sparse warnings
  [WATCHDOG] ibmasr: remove unnecessary spin_unlock()

Showing 5 changed files Side-by-side Diff

drivers/watchdog/geodewdt.c
... ... @@ -130,8 +130,8 @@
130 130 return len;
131 131 }
132 132  
133   -static int geodewdt_ioctl(struct inode *inode, struct file *file,
134   - unsigned int cmd, unsigned long arg)
  133 +static long geodewdt_ioctl(struct file *file, unsigned int cmd,
  134 + unsigned long arg)
135 135 {
136 136 void __user *argp = (void __user *)arg;
137 137 int __user *p = argp;
... ... @@ -198,7 +198,7 @@
198 198 .owner = THIS_MODULE,
199 199 .llseek = no_llseek,
200 200 .write = geodewdt_write,
201   - .ioctl = geodewdt_ioctl,
  201 + .unlocked_ioctl = geodewdt_ioctl,
202 202 .open = geodewdt_open,
203 203 .release = geodewdt_release,
204 204 };
drivers/watchdog/pnx4008_wdt.c
... ... @@ -173,8 +173,8 @@
173 173 .identity = "PNX4008 Watchdog",
174 174 };
175 175  
176   -static long pnx4008_wdt_ioctl(struct inode *inode, struct file *file,
177   - unsigned int cmd, unsigned long arg)
  176 +static long pnx4008_wdt_ioctl(struct file *file, unsigned int cmd,
  177 + unsigned long arg)
178 178 {
179 179 int ret = -ENOTTY;
180 180 int time;
drivers/watchdog/rc32434_wdt.c
... ... @@ -182,8 +182,8 @@
182 182 return 0;
183 183 }
184 184  
185   -static int rc32434_wdt_ioctl(struct inode *inode, struct file *file,
186   - unsigned int cmd, unsigned long arg)
  185 +static long rc32434_wdt_ioctl(struct file *file, unsigned int cmd,
  186 + unsigned long arg)
187 187 {
188 188 void __user *argp = (void __user *)arg;
189 189 int new_timeout;
... ... @@ -242,7 +242,7 @@
242 242 .owner = THIS_MODULE,
243 243 .llseek = no_llseek,
244 244 .write = rc32434_wdt_write,
245   - .ioctl = rc32434_wdt_ioctl,
  245 + .unlocked_ioctl = rc32434_wdt_ioctl,
246 246 .open = rc32434_wdt_open,
247 247 .release = rc32434_wdt_release,
248 248 };
drivers/watchdog/rdc321x_wdt.c
... ... @@ -144,8 +144,8 @@
144 144 return 0;
145 145 }
146 146  
147   -static int rdc321x_wdt_ioctl(struct inode *inode, struct file *file,
148   - unsigned int cmd, unsigned long arg)
  147 +static long rdc321x_wdt_ioctl(struct file *file, unsigned int cmd,
  148 + unsigned long arg)
149 149 {
150 150 void __user *argp = (void __user *)arg;
151 151 unsigned int value;
... ... @@ -204,7 +204,7 @@
204 204 static const struct file_operations rdc321x_wdt_fops = {
205 205 .owner = THIS_MODULE,
206 206 .llseek = no_llseek,
207   - .ioctl = rdc321x_wdt_ioctl,
  207 + .unlocked_ioctl = rdc321x_wdt_ioctl,
208 208 .open = rdc321x_wdt_open,
209 209 .write = rdc321x_wdt_write,
210 210 .release = rdc321x_wdt_release,
drivers/watchdog/wdt285.c
... ... @@ -115,8 +115,8 @@
115 115 return 0;
116 116 }
117 117  
118   -static ssize_t watchdog_write(struct file *file, const char *data,
119   - size_t len, loff_t *ppos)
  118 +static ssize_t watchdog_write(struct file *file, const char __user *data,
  119 + size_t len, loff_t *ppos)
120 120 {
121 121 /*
122 122 * Refresh the timer.
123 123  
124 124  
125 125  
... ... @@ -133,21 +133,22 @@
133 133 };
134 134  
135 135 static long watchdog_ioctl(struct file *file, unsigned int cmd,
136   - unsigned long arg)
  136 + unsigned long arg)
137 137 {
138 138 unsigned int new_margin;
  139 + int __user *int_arg = (int __user *)arg;
139 140 int ret = -ENOTTY;
140 141  
141 142 switch (cmd) {
142 143 case WDIOC_GETSUPPORT:
143 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 146 ret = -EFAULT;
146 147 break;
147 148  
148 149 case WDIOC_GETSTATUS:
149 150 case WDIOC_GETBOOTSTATUS:
150   - ret = put_user(0, (int *)arg);
  151 + ret = put_user(0, int_arg);
151 152 break;
152 153  
153 154 case WDIOC_KEEPALIVE:
... ... @@ -156,7 +157,7 @@
156 157 break;
157 158  
158 159 case WDIOC_SETTIMEOUT:
159   - ret = get_user(new_margin, (int *)arg);
  160 + ret = get_user(new_margin, int_arg);
160 161 if (ret)
161 162 break;
162 163  
... ... @@ -171,7 +172,7 @@
171 172 watchdog_ping();
172 173 /* Fall */
173 174 case WDIOC_GETTIMEOUT:
174   - ret = put_user(soft_margin, (int *)arg);
  175 + ret = put_user(soft_margin, int_arg);
175 176 break;
176 177 }
177 178 return ret;