[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>

authored by Al Viro and committed by Linus Torvalds b2846dfa ae8aed03

+7 -7
+7 -7
drivers/char/watchdog/mv64x60_wdt.c
··· 87 87 mv64x60_wdt_service(); 88 88 mv64x60_wdt_handler_enable(); 89 89 90 + nonseekable_open(inode, file); 91 + 90 92 return 0; 91 93 } 92 94 ··· 105 103 return 0; 106 104 } 107 105 108 - static ssize_t mv64x60_wdt_write(struct file *file, const char *data, 106 + static ssize_t mv64x60_wdt_write(struct file *file, const char __user *data, 109 107 size_t len, loff_t * ppos) 110 108 { 111 - if (*ppos != file->f_pos) 112 - return -ESPIPE; 113 - 114 109 if (len) 115 110 mv64x60_wdt_service(); 116 111 ··· 118 119 unsigned int cmd, unsigned long arg) 119 120 { 120 121 int timeout; 122 + void __user *argp = (void __user *)arg; 121 123 static struct watchdog_info info = { 122 124 .options = WDIOF_KEEPALIVEPING, 123 125 .firmware_version = 0, ··· 127 127 128 128 switch (cmd) { 129 129 case WDIOC_GETSUPPORT: 130 - if (copy_to_user((void *)arg, &info, sizeof(info))) 130 + if (copy_to_user(argp, &info, sizeof(info))) 131 131 return -EFAULT; 132 132 break; 133 133 134 134 case WDIOC_GETSTATUS: 135 135 case WDIOC_GETBOOTSTATUS: 136 - if (put_user(wdt_status, (int *)arg)) 136 + if (put_user(wdt_status, (int __user *)argp)) 137 137 return -EFAULT; 138 138 wdt_status &= ~WDIOF_KEEPALIVEPING; 139 139 break; ··· 154 154 155 155 case WDIOC_GETTIMEOUT: 156 156 timeout = mv64x60_wdt_timeout * HZ; 157 - if (put_user(timeout, (int *)arg)) 157 + if (put_user(timeout, (int __user *)argp)) 158 158 return -EFAULT; 159 159 break; 160 160