lkml.org 
[lkml]   [2010]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] Input: stmpe-ts - return -ENOMEM if memory allocation fail
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/ |
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2010-09-04 07:47    [W:0.083 / U:0.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site