mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wolfram Sang <w.sang@pengutronix.de>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Axel Lin <axel.lin@gmail.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Luotao Fu <l.fu@pengutronix.de>,
	linux-input@vger.kernel.org
Subject: Re: [PATCH 2/2] Input: stmpe-ts - return -ENOMEM if memory allocation fail
Date: Sat, 4 Sep 2010 07:45:11 +0200	[thread overview]
Message-ID: <20100904054511.GA12920@pengutronix.de> (raw)
In-Reply-To: <20100903214540.GB6412@core.coreip.homeip.net>

[-- Attachment #1: Type: text/plain, Size: 1003 bytes --]

On Fri, Sep 03, 2010 at 02:45:40PM -0700, Dmitry Torokhov wrote:
> On Fri, Sep 03, 2010 at 11:35:24PM +0200, Wolfram Sang wrote:
> > On Fri, Sep 03, 2010 at 09:32:13AM +0800, Axel Lin wrote:
> > > Signed-off-by: Axel Lin <axel.lin@gmail.com>
> > 
> > Basically correct. Should be simpler to just use
> > 
> > 	int ret = -ENOMEM;
> > 
> > though.
> > 
> 
> No! I hate when people initialize error values like that, because it is

Might be a mileage; I don't insist, though :)

> so easy to miss the case and end up with wrong value. If the original
> version of the driver did not initialize it to 0 compiler would warn
> the author and the error would not make it into the mainline to begin
> with.

So, the initialization to 0 could be removed, at least.

> Please explicitly assign error codes in error handling path.

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2010-09-04  5:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-03  1:30 [PATCH 1/2] Input: stmpe-ts - remove input_free_device() in stmpe_ts_remove() Axel Lin
2010-09-03  1:32 ` [PATCH 2/2] Input: stmpe-ts - return -ENOMEM if memory allocation fail Axel Lin
2010-09-03 21:35   ` Wolfram Sang
2010-09-03 21:45     ` Dmitry Torokhov
2010-09-04  5:45       ` Wolfram Sang [this message]
2010-09-03  7:13 ` [PATCH 1/2] Input: stmpe-ts - remove input_free_device() in stmpe_ts_remove() Luotao Fu

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=20100904054511.GA12920@pengutronix.de \
    --to=w.sang@pengutronix.de \
    --cc=axel.lin@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=l.fu@pengutronix.de \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®