lkml.org 
[lkml]   [2006]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
DateSun, 01 Oct 2006 12:08:03 -0400
FromJeff Garzik <>
SubjectRe: [PATCH] fs/eventpoll: error handling micro-cleanup
Davide Libenzi wrote:
> On Sun, 1 Oct 2006, Jeff Garzik wrote:
>
>> While reviewing the 'may be used uninitialized' bogus gcc warnings,
>> I noticed that an error code assignment was only needed if an error had
>> actually occured.
>
> But that saved one line of code, and there are countless occurences in the
> kernel of such code pattern ;)

I'm not sure there are countless occurrences with PTR_ERR(). The line
is incorrect (but harmless) if inode is a valid pointer...


> In any case, fine by me and not worth further discussion.

Thanks :)


>> --- a/fs/eventpoll.c
>> +++ b/fs/eventpoll.c
>> @@ -720,9 +720,10 @@ static int ep_getfd(int *efd, struct ino
>>
>> /* Allocates an inode from the eventpoll file system */
>> inode = ep_eventpoll_inode();
>> - error = PTR_ERR(inode);
>> - if (IS_ERR(inode))
>> + if (IS_ERR(inode)) {
>> + error = PTR_ERR(inode);


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-10-01 18:11    [from the cache]
©2003-2010