aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/usb/host/uhci-debug.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-12-05 22:04:48 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2015-12-23 10:41:31 -0500
commitb25472f9b96159cc0b9b7ed449448805973cd789 (patch)
tree7963f6d5adc2a82f6f10b4f9cf427ce931f67c76 /drivers/usb/host/uhci-debug.c
parentdon't open-code generic_file_llseek_size() (diff)
downloadwireguard-linux-b25472f9b96159cc0b9b7ed449448805973cd789.tar.xz
wireguard-linux-b25472f9b96159cc0b9b7ed449448805973cd789.zip
new helpers: no_seek_end_llseek{,_size}()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/usb/host/uhci-debug.c')
-rw-r--r--drivers/usb/host/uhci-debug.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c
index 1b28a000d5c6..9c6635d43db0 100644
--- a/drivers/usb/host/uhci-debug.c
+++ b/drivers/usb/host/uhci-debug.c
@@ -584,27 +584,8 @@ static int uhci_debug_open(struct inode *inode, struct file *file)
static loff_t uhci_debug_lseek(struct file *file, loff_t off, int whence)
{
- struct uhci_debug *up;
- loff_t new = -1;
-
- up = file->private_data;
-
- /*
- * XXX: atomic 64bit seek access, but that needs to be fixed in the VFS
- */
- switch (whence) {
- case 0:
- new = off;
- break;
- case 1:
- new = file->f_pos + off;
- break;
- }
-
- if (new < 0 || new > up->size)
- return -EINVAL;
-
- return (file->f_pos = new);
+ struct uhci_debug *up = file->private_data;
+ return no_seek_end_llseek_size(file, off, whence, up->size);
}
static ssize_t uhci_debug_read(struct file *file, char __user *buf,