Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
[firefly-linux-kernel-4.4.55.git] / arch / powerpc / kernel / proc_powerpc.c
index feb8580fdc843acc485df310ed1c072907dc7159..c30612aad68ebd5f239776a3b4c6cf66ea94bf1e 100644 (file)
 
 #ifdef CONFIG_PPC64
 
-static loff_t page_map_seek( struct file *file, loff_t off, int whence)
+static loff_t page_map_seek(struct file *file, loff_t off, int whence)
 {
-       loff_t new;
-       switch(whence) {
-       case 0:
-               new = off;
-               break;
-       case 1:
-               new = file->f_pos + off;
-               break;
-       case 2:
-               new = PAGE_SIZE + off;
-               break;
-       default:
-               return -EINVAL;
-       }
-       if ( new < 0 || new > PAGE_SIZE )
-               return -EINVAL;
-       return (file->f_pos = new);
+       return fixed_size_llseek(file, off, whence, PAGE_SIZE);
 }
 
 static ssize_t page_map_read( struct file *file, char __user *buf, size_t nbytes,