All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@grandegger.com>
To: David Miller <davem@davemloft.net>
Cc: oliver.hartkopp@volkswagen.de, xemul@openvz.org,
	socketcan-core@lists.berlios.de, netdev@vger.kernel.org,
	urs.thuermann@volkswagen.de
Subject: Re: [PATCH][CAN]: Fix copy_from_user() results interpretation.
Date: Sat, 26 Apr 2008 08:35:24 +0200	[thread overview]
Message-ID: <4812CD2C.30307@grandegger.com> (raw)
In-Reply-To: <20080425.232310.186704312.davem@davemloft.net>

David Miller wrote:
> From: Wolfgang Grandegger <wg@grandegger.com>
> 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.


  reply	other threads:[~2008-04-26  6:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-25 12:42 [PATCH][CAN]: Fix copy_from_user() results interpretation Pavel Emelyanov
2008-04-25 14:22 ` Oliver Hartkopp
2008-04-26  6:19   ` Wolfgang Grandegger
2008-04-26  6:23     ` David Miller
2008-04-26  6:35       ` Wolfgang Grandegger [this message]
2008-04-26  6:40     ` Sam Ravnborg
2008-04-26  7:03       ` David Miller
2008-04-26 13:04         ` Wolfgang Grandegger
2008-04-26  8:26       ` Oliver Hartkopp
2008-04-26  9:10         ` David Miller
2008-04-26  9:59           ` Sam Ravnborg
2008-04-26 10:01             ` David Miller
2008-04-26 10:05               ` Sam Ravnborg
2008-04-27  5:57             ` David Miller
     [not found] <mailman.2289.1209191345.4974.socketcan-core@lists.berlios.de>
2008-04-26  6:33 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4812CD2C.30307@grandegger.com \
    --to=wg@grandegger.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=oliver.hartkopp@volkswagen.de \
    --cc=socketcan-core@lists.berlios.de \
    --cc=urs.thuermann@volkswagen.de \
    --cc=xemul@openvz.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.