diff options
Diffstat (limited to 'arch/powerpc/kernel/nvram_64.c')
-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 @@ | |||
27 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
28 | #include <linux/spinlock.h> | 28 | #include <linux/spinlock.h> |
29 | #include <linux/kmsg_dump.h> | 29 | #include <linux/kmsg_dump.h> |
30 | #include <linux/pagemap.h> | ||
30 | #include <linux/pstore.h> | 31 | #include <linux/pstore.h> |
31 | #include <linux/zlib.h> | 32 | #include <linux/zlib.h> |
32 | #include <asm/uaccess.h> | 33 | #include <asm/uaccess.h> |
@@ -733,24 +734,10 @@ static void oops_to_nvram(struct kmsg_dumper *dumper, | |||
733 | 734 | ||
734 | static loff_t dev_nvram_llseek(struct file *file, loff_t offset, int origin) | 735 | static loff_t dev_nvram_llseek(struct file *file, loff_t offset, int origin) |
735 | { | 736 | { |
736 | int size; | ||
737 | |||
738 | if (ppc_md.nvram_size == NULL) | 737 | if (ppc_md.nvram_size == NULL) |
739 | return -ENODEV; | 738 | return -ENODEV; |
740 | size = ppc_md.nvram_size(); | 739 | return generic_file_llseek_size(file, offset, origin, MAX_LFS_FILESIZE, |
741 | 740 | ppc_md.nvram_size()); | |
742 | switch (origin) { | ||
743 | case 1: | ||
744 | offset += file->f_pos; | ||
745 | break; | ||
746 | case 2: | ||
747 | offset += size; | ||
748 | break; | ||
749 | } | ||
750 | if (offset < 0) | ||
751 | return -EINVAL; | ||
752 | file->f_pos = offset; | ||
753 | return file->f_pos; | ||
754 | } | 741 | } |
755 | 742 | ||
756 | 743 | ||