[PATCH v7 09/26] char/nvram: Use generic fixed_size_llseek()

From: Finn Thain
Date: Sun Nov 01 2015 - 05:53:30 EST


Signed-off-by: Finn Thain <fthain@xxxxxxxxxxxxxxxxxxx>

---
drivers/char/nvram.c | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)

Index: linux/drivers/char/nvram.c
===================================================================
--- linux.orig/drivers/char/nvram.c 2015-11-01 21:41:34.000000000 +1100
+++ linux/drivers/char/nvram.c 2015-11-01 21:41:35.000000000 +1100
@@ -235,21 +235,7 @@ EXPORT_SYMBOL(arch_nvram_ops);

static loff_t nvram_misc_llseek(struct file *file, loff_t offset, int origin)
{
- switch (origin) {
- case 0:
- /* nothing to do */
- break;
- case 1:
- offset += file->f_pos;
- break;
- case 2:
- offset += NVRAM_BYTES;
- break;
- default:
- return -EINVAL;
- }
-
- return (offset >= 0) ? (file->f_pos = offset) : -EINVAL;
+ return fixed_size_llseek(file, offset, origin, nvram_size);
}

static ssize_t nvram_misc_read(struct file *file, char __user *buf,


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/