HID: hidraw: Replace Confusing += Operator with =
authorAlan Ott <alan@signal11.us>
Thu, 27 Jan 2011 03:25:18 +0000 (22:25 -0500)
committerJiri Kosina <jkosina@suse.cz>
Mon, 31 Jan 2011 14:43:46 +0000 (15:43 +0100)
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 <alan@signal11.us>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hidraw.c

index 468e87b53ed26aadb86ed6b127599ea669a6aa99..66fbcbae53435d0c09d014abdf61fbb6357a851d 100644 (file)
@@ -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);