Signed-off-by: Akinobu Mita Cc: Greg Kroah-Hartman --- drivers/usb/mon/mon_stat.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) Index: 2.6-git/drivers/usb/mon/mon_stat.c =================================================================== --- 2.6-git.orig/drivers/usb/mon/mon_stat.c +++ 2.6-git/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 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) -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/