From 1af39287ad3a202937b74815b0736c82f2e95c63 Mon Sep 17 00:00:00 2001 From: Steve Wise Date: Wed, 29 Sep 2010 18:21:33 +0000 Subject: [PATCH] --- yaml --- r: 217725 b: refs/heads/master c: 3160977a6e66ea4c4b4f33010f5d04f0004b938c h: refs/heads/master i: 217723: eda78d657dd94a53169bcb41ee3a95dcc1f51527 v: v3 --- [refs] | 2 +- trunk/drivers/infiniband/hw/cxgb4/device.c | 26 +--------------------- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/[refs] b/[refs] index ed33937555ac..1cfe9a12072c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8bbac892fb75d20fa274ca026e24faf00afbf9dd +refs/heads/master: 3160977a6e66ea4c4b4f33010f5d04f0004b938c diff --git a/trunk/drivers/infiniband/hw/cxgb4/device.c b/trunk/drivers/infiniband/hw/cxgb4/device.c index b25435736d44..22a290d0d5bf 100644 --- a/trunk/drivers/infiniband/hw/cxgb4/device.c +++ b/trunk/drivers/infiniband/hw/cxgb4/device.c @@ -68,32 +68,8 @@ static ssize_t debugfs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct c4iw_debugfs_data *d = file->private_data; - loff_t pos = *ppos; - loff_t avail = d->pos; - if (pos < 0) - return -EINVAL; - if (pos >= avail) - return 0; - if (count > avail - pos) - count = avail - pos; - - while (count) { - size_t len = 0; - - len = min((int)count, (int)d->pos - (int)pos); - if (copy_to_user(buf, d->buf + pos, len)) - return -EFAULT; - if (len == 0) - return -EINVAL; - - buf += len; - pos += len; - count -= len; - } - count = pos - *ppos; - *ppos = pos; - return count; + return simple_read_from_buffer(buf, count, ppos, d->buf, d->pos); } static int dump_qp(int id, void *p, void *data)