Subject: Re: [PATCH][CAN]: Fix copy_from_user() results interpretation.

From: Wolfgang Grandegger <[email-masked]>
Date: Sat, 26 Apr 2008 08:35:24 +0200

David Miller wrote:
> From: Wolfgang Grandegger <[email-masked]>
> Date: Sat, 26 Apr 2008 08:19:31 +0200
> 
>> What about removing the assignment "err =" in that case. It's confusing
>> otherwise and maybe the variable err is even obsolete.
> 
> Sure, but when fixing a bug it's better to have a completely
> localized change like this.
> 
> Not something which restructures the code unnecessarily at
> the same time, that make it so much harder to review and
> validate.

Well, really,

   if (func(x))
        return -EFAULT;

instead of

   err = func(x);
   if (err)
	return -EFAULT;

is more straight forward and less confusing and I do not understand, why
it should be harder to review.

Wolfgang.