From: Alan Ott Date: Thu, 27 Jan 2011 03:25:18 +0000 (-0500) Subject: HID: hidraw: Replace Confusing += Operator with = X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=cf28a673666fba5770b40fb084584391f451c07d;p=deliverable%2Flinux.git HID: hidraw: Replace Confusing += Operator with = Setting of the return value of hidraw_read() uses the += operator when = is more appropriate. There is no case where ret can be anything other than zero when the assignment is made, making = equivalent to += and much more clear. Signed-off-by: Alan Ott Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c index 468e87b53ed2..66fbcbae5343 100644 --- a/drivers/hid/hidraw.c +++ b/drivers/hid/hidraw.c @@ -91,7 +91,7 @@ static ssize_t hidraw_read(struct file *file, char __user *buffer, size_t count, ret = -EFAULT; goto out; } - ret += len; + ret = len; kfree(list->buffer[list->tail].value); list->tail = (list->tail + 1) & (HIDRAW_BUFFER_SIZE - 1);