From: Al Viro Date: Tue, 19 Aug 2014 16:06:18 +0000 (-0400) Subject: carma-fpga: switch to fixed_size_llseek() X-Git-Tag: v3.18-rc1~76^2~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1a37f5ecb707aded73133e14b58102343de56bbd;p=platform%2Fkernel%2Flinux-stable.git carma-fpga: switch to fixed_size_llseek() Signed-off-by: Al Viro --- diff --git a/drivers/misc/carma/carma-fpga-program.c b/drivers/misc/carma/carma-fpga-program.c index 7be8983..f390dee 100644 --- a/drivers/misc/carma/carma-fpga-program.c +++ b/drivers/misc/carma/carma-fpga-program.c @@ -767,26 +767,7 @@ static loff_t fpga_llseek(struct file *filp, loff_t offset, int origin) if ((filp->f_flags & O_ACCMODE) != O_RDONLY) return -EINVAL; - switch (origin) { - case SEEK_SET: /* seek relative to the beginning of the file */ - newpos = offset; - break; - case SEEK_CUR: /* seek relative to current position in the file */ - newpos = filp->f_pos + offset; - break; - case SEEK_END: /* seek relative to the end of the file */ - newpos = priv->fw_size - offset; - break; - default: - return -EINVAL; - } - - /* check for sanity */ - if (newpos > priv->fw_size) - return -EINVAL; - - filp->f_pos = newpos; - return newpos; + return fixed_size_llseek(file, offset, origin, priv->fw_size); } static const struct file_operations fpga_fops = {