Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 104593
b: refs/heads/master
c: 518386c
h: refs/heads/master
i:
  104591: a42b68d
v: v3
  • Loading branch information
Akinobu Mita authored and Greg Kroah-Hartman committed Jul 21, 2008
1 parent 70b7f36 commit 33810f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bef4665a2e5145737fa925a5a1a7a8afd1b91acc
refs/heads/master: 518386c7d4cc3eb8e6b815e0b11ed2cec6245907
14 changes: 2 additions & 12 deletions trunk/drivers/usb/mon/mon_stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <linux/kernel.h>
#include <linux/usb.h>
#include <linux/fs.h>
#include <asm/uaccess.h>

#include "usb_mon.h"
Expand Down Expand Up @@ -42,19 +43,8 @@ static ssize_t mon_stat_read(struct file *file, char __user *buf,
size_t nbytes, loff_t *ppos)
{
struct snap *sp = file->private_data;
loff_t pos = *ppos;
int cnt;

if (pos < 0 || pos >= sp->slen)
return 0;
if (nbytes == 0)
return 0;
if ((cnt = sp->slen - pos) > nbytes)
cnt = nbytes;
if (copy_to_user(buf, sp->str + pos, cnt))
return -EFAULT;
*ppos = pos + cnt;
return cnt;
return simple_read_from_buffer(buf, nbytes, ppos, sp->str, sp->slen);
}

static int mon_stat_release(struct inode *inode, struct file *file)
Expand Down

0 comments on commit 33810f9

Please sign in to comment.