diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-12-06 03:39:06 +0100 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-12-09 19:00:45 +0100 |
commit | b808b1d632f6915e4d6b1badb927b2c970ad11bb (patch) | |
tree | b3c85ccbb0a685d4beae45598518307624ccb6ac /arch | |
parent | restore_nameidata(): no need to clear now->stack (diff) | |
download | linux-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 'arch')
-rw-r--r-- | arch/powerpc/kernel/nvram_64.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c index 32e26526f7e4..0cab9e8c3794 100644 --- a/arch/powerpc/kernel/nvram_64.c +++ b/arch/powerpc/kernel/nvram_64.c @@ -27,6 +27,7 @@ #include <linux/slab.h> #include <linux/spinlock.h> #include <linux/kmsg_dump.h> +#include <linux/pagemap.h> #include <linux/pstore.h> #include <linux/zlib.h> #include <asm/uaccess.h> @@ -733,24 +734,10 @@ static void oops_to_nvram(struct kmsg_dumper *dumper, static loff_t dev_nvram_llseek(struct file *file, loff_t offset, int origin) { - int size; - if (ppc_md.nvram_size == NULL) return -ENODEV; - size = ppc_md.nvram_size(); - - switch (origin) { - case 1: - offset += file->f_pos; - break; - case 2: - offset += size; - break; - } - if (offset < 0) - return -EINVAL; - file->f_pos = offset; - return file->f_pos; + return generic_file_llseek_size(file, offset, origin, MAX_LFS_FILESIZE, + ppc_md.nvram_size()); } |