From 33810f9567f44500bb2be69463b986eb78674470 Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Mon, 9 Jun 2008 16:39:57 -0700 Subject: [PATCH] --- yaml --- r: 104593 b: refs/heads/master c: 518386c7d4cc3eb8e6b815e0b11ed2cec6245907 h: refs/heads/master i: 104591: a42b68d63bb88c1a606efbd2eccf043fd80d3635 v: v3 --- [refs] | 2 +- trunk/drivers/usb/mon/mon_stat.c | 14 ++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/[refs] b/[refs] index 9384493f34ce..b8774a3963fc 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: bef4665a2e5145737fa925a5a1a7a8afd1b91acc +refs/heads/master: 518386c7d4cc3eb8e6b815e0b11ed2cec6245907 diff --git a/trunk/drivers/usb/mon/mon_stat.c b/trunk/drivers/usb/mon/mon_stat.c index c7a595cd648a..ac8b0d5ce7f8 100644 --- a/trunk/drivers/usb/mon/mon_stat.c +++ b/trunk/drivers/usb/mon/mon_stat.c @@ -9,6 +9,7 @@ #include #include +#include #include #include "usb_mon.h" @@ -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)