lkml.org 
[lkml]   [2011]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] hidraw: Replace Confusing += Operator with =
On Wed, 26 Jan 2011, Alan Ott wrote:

> 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>
> ---
> drivers/hid/hidraw.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c
> index 468e87b..66fbcba 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;
>

Applied, thanks.

--
Jiri Kosina
SUSE Labs, Novell Inc.


\
 
 \ /
  Last update: 2011-01-31 15:47    [W:1.633 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site