lkml.org 
[lkml]   [2015]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[RFC v4 10/25] char/nvram: Use generic fixed_size_llseek()
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>

---
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-07-12 20:25:03.000000000 +1000
+++ linux/drivers/char/nvram.c 2015-07-12 20:25:05.000000000 +1000
@@ -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,



\
 
 \ /
  Last update: 2015-07-12 13:01    [W:0.154 / U:1.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site