diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-06-23 04:46:49 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-06-29 04:57:52 -0400 |
commit | d2c40f789f6c98c50bf01cf84ef46415fb7a2776 (patch) | |
tree | 66a28f4f4af9b4e58b9d92662ae7ed2a9c6ad571 /drivers/pci/hotplug/cpqphp_sysfs.c | |
parent | 914961aac077b5aebb4ae669d7c42d231826970b (diff) |
cpqphp_sysfs: switch to fixed_size_llseek()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/pci/hotplug/cpqphp_sysfs.c')
-rw-r--r-- | drivers/pci/hotplug/cpqphp_sysfs.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/drivers/pci/hotplug/cpqphp_sysfs.c b/drivers/pci/hotplug/cpqphp_sysfs.c index 4cb30447a486..17c1f36315d1 100644 --- a/drivers/pci/hotplug/cpqphp_sysfs.c +++ b/drivers/pci/hotplug/cpqphp_sysfs.c | |||
@@ -167,26 +167,8 @@ exit: | |||
167 | 167 | ||
168 | static loff_t lseek(struct file *file, loff_t off, int whence) | 168 | static loff_t lseek(struct file *file, loff_t off, int whence) |
169 | { | 169 | { |
170 | struct ctrl_dbg *dbg; | 170 | struct ctrl_dbg *dbg = file->private_data; |
171 | loff_t new = -1; | 171 | return fixed_size_llseek(file, off, whence, dbg->size); |
172 | |||
173 | mutex_lock(&cpqphp_mutex); | ||
174 | dbg = file->private_data; | ||
175 | |||
176 | switch (whence) { | ||
177 | case 0: | ||
178 | new = off; | ||
179 | break; | ||
180 | case 1: | ||
181 | new = file->f_pos + off; | ||
182 | break; | ||
183 | } | ||
184 | if (new < 0 || new > dbg->size) { | ||
185 | mutex_unlock(&cpqphp_mutex); | ||
186 | return -EINVAL; | ||
187 | } | ||
188 | mutex_unlock(&cpqphp_mutex); | ||
189 | return (file->f_pos = new); | ||
190 | } | 172 | } |
191 | 173 | ||
192 | static ssize_t read(struct file *file, char __user *buf, | 174 | static ssize_t read(struct file *file, char __user *buf, |