bna: switch to fixed_size_llseek()
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 17 Jun 2013 11:23:54 +0000 (15:23 +0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 29 Jun 2013 08:57:28 +0000 (12:57 +0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
drivers/net/ethernet/brocade/bna/bnad_debugfs.c

index 94d957d..7d6aa8c 100644 (file)
@@ -230,32 +230,12 @@ bnad_debugfs_open_drvinfo(struct inode *inode, struct file *file)
 static loff_t
 bnad_debugfs_lseek(struct file *file, loff_t offset, int orig)
 {
-       loff_t pos = file->f_pos;
        struct bnad_debug_info *debug = file->private_data;
 
        if (!debug)
                return -EINVAL;
 
-       switch (orig) {
-       case 0:
-               file->f_pos = offset;
-               break;
-       case 1:
-               file->f_pos += offset;
-               break;
-       case 2:
-               file->f_pos = debug->buffer_len + offset;
-               break;
-       default:
-               return -EINVAL;
-       }
-
-       if (file->f_pos < 0 || file->f_pos > debug->buffer_len) {
-               file->f_pos = pos;
-               return -EINVAL;
-       }
-
-       return file->f_pos;
+       return fixed_size_llseek(file, offset, orig, debug->buffer_len);
 }
 
 static ssize_t