From 22735068d53c7115e384bc88dea95b17e76a6839 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Mon, 18 Jul 2011 13:21:39 -0400 Subject: drivers: fix up various ->llseek() implementations Fix up a few ->llseek() implementations that won't deal with SEEK_HOLE/SEEK_DATA properly. Make them future proof so that if we ever add new options they will return -EINVAL. Thanks, Signed-off-by: Josef Bacik Signed-off-by: Al Viro --- drivers/macintosh/nvram.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/macintosh') diff --git a/drivers/macintosh/nvram.c b/drivers/macintosh/nvram.c index a271c8218d82..f0e03e7937e3 100644 --- a/drivers/macintosh/nvram.c +++ b/drivers/macintosh/nvram.c @@ -21,12 +21,16 @@ 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_SIZE; break; + default: + offset = -1; } if (offset < 0) return -EINVAL; -- cgit v1.2.3