aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-06-17 07:23:54 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-06-29 04:57:28 -0400
commitc0caa07b6ab714caaea7beaa5a2e3cbf541f0831 (patch)
treedfc96e4cf3746ec88ecd3554af378c5140fb1481 /drivers/net
parent3be1f2b81f6f9b333fe6fb5ac49c4a419786e859 (diff)
bna: switch to fixed_size_llseek()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/brocade/bna/bnad_debugfs.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/drivers/net/ethernet/brocade/bna/bnad_debugfs.c b/drivers/net/ethernet/brocade/bna/bnad_debugfs.c
index 94d957d203a6..7d6aa8c87df8 100644
--- a/drivers/net/ethernet/brocade/bna/bnad_debugfs.c
+++ b/drivers/net/ethernet/brocade/bna/bnad_debugfs.c
@@ -230,32 +230,12 @@ bnad_debugfs_open_drvinfo(struct inode *inode, struct file *file)
230static loff_t 230static loff_t
231bnad_debugfs_lseek(struct file *file, loff_t offset, int orig) 231bnad_debugfs_lseek(struct file *file, loff_t offset, int orig)
232{ 232{
233 loff_t pos = file->f_pos;
234 struct bnad_debug_info *debug = file->private_data; 233 struct bnad_debug_info *debug = file->private_data;
235 234
236 if (!debug) 235 if (!debug)
237 return -EINVAL; 236 return -EINVAL;
238 237
239 switch (orig) { 238 return fixed_size_llseek(file, offset, orig, debug->buffer_len);
240 case 0:
241 file->f_pos = offset;
242 break;
243 case 1:
244 file->f_pos += offset;
245 break;
246 case 2:
247 file->f_pos = debug->buffer_len + offset;
248 break;
249 default:
250 return -EINVAL;
251 }
252
253 if (file->f_pos < 0 || file->f_pos > debug->buffer_len) {
254 file->f_pos = pos;
255 return -EINVAL;
256 }
257
258 return file->f_pos;
259} 239}
260 240
261static ssize_t 241static ssize_t