summaryrefslogtreecommitdiffstats
path: root/drivers/char/generic_nvram.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-12-06 03:39:06 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2015-12-09 19:00:45 +0100
commitb808b1d632f6915e4d6b1badb927b2c970ad11bb (patch)
treeb3c85ccbb0a685d4beae45598518307624ccb6ac /drivers/char/generic_nvram.c
parentrestore_nameidata(): no need to clear now->stack (diff)
downloadlinux-b808b1d632f6915e4d6b1badb927b2c970ad11bb.tar.xz
linux-b808b1d632f6915e4d6b1badb927b2c970ad11bb.zip
don't open-code generic_file_llseek_size()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/char/generic_nvram.c')
-rw-r--r--drivers/char/generic_nvram.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/drivers/char/generic_nvram.c b/drivers/char/generic_nvram.c
index 6c4f4b5a9dd3..073db9558379 100644
--- a/drivers/char/generic_nvram.c
+++ b/drivers/char/generic_nvram.c
@@ -20,6 +20,7 @@
#include <linux/fcntl.h>
#include <linux/init.h>
#include <linux/mutex.h>
+#include <linux/pagemap.h>
#include <asm/uaccess.h>
#include <asm/nvram.h>
#ifdef CONFIG_PPC_PMAC
@@ -33,24 +34,8 @@ static ssize_t nvram_len;
static loff_t nvram_llseek(struct file *file, loff_t offset, int origin)
{
- switch (origin) {
- case 0:
- break;
- case 1:
- offset += file->f_pos;
- break;
- case 2:
- offset += nvram_len;
- break;
- default:
- offset = -1;
- }
- if (offset < 0)
- return -EINVAL;
-
- file->f_pos = offset;
-
- return file->f_pos;
+ return generic_file_llseek_size(file, offset, origin,
+ MAX_LFS_FILESIZE, nvram_len);
}
static ssize_t read_nvram(struct file *file, char __user *buf,