Skip to content

Commit

Permalink
HID: hidraw: Replace Confusing += Operator with =
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
  • Loading branch information
signal11 authored and Jiri Kosina committed Jan 31, 2011
1 parent 581548d commit cf28a67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hid/hidraw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cf28a67

Please sign in to comment.