lpfc: switch to fixed_size_llseek()
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 23 Jun 2013 08:08:05 +0000 (12:08 +0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 29 Jun 2013 08:57:47 +0000 (12:57 +0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
drivers/scsi/lpfc/lpfc_debugfs.c

index f525ecb7a9c6e187bf1097a6baf7aabad96377a4..60084e6ad2f24331c6bab3e74d4869f13a5dca0c 100644 (file)
@@ -1165,22 +1165,8 @@ out:
 static loff_t
 lpfc_debugfs_lseek(struct file *file, loff_t off, int whence)
 {
-       struct lpfc_debug *debug;
-       loff_t pos = -1;
-
-       debug = file->private_data;
-
-       switch (whence) {
-       case 0:
-               pos = off;
-               break;
-       case 1:
-               pos = file->f_pos + off;
-               break;
-       case 2:
-               pos = debug->len + off;
-       }
-       return (pos < 0 || pos > debug->len) ? -EINVAL : (file->f_pos = pos);
+       struct lpfc_debug *debug = file->private_data;
+       return fixed_size_llseek(file, off, whence, debug->len);
 }
 
 /**