All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fs/eventpoll: error handling micro-cleanup
@ 2006-10-01 12:43 Jeff Garzik
  2006-10-01 16:04 ` Davide Libenzi
  0 siblings, 1 reply; 8+ messages in thread
From: Jeff Garzik @ 2006-10-01 12:43 UTC (permalink / raw)
  To: Andrew Morton, LKML; +Cc: davidel


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.

Signed-off-by: Jeff Garzik <jeff@garzik.org>

diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 8d54433..557d5b6 100644
--- 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);
 		goto eexit_2;
+	}
 
 	/* Allocates a free descriptor to plug the file onto */
 	error = get_unused_fd();

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-10-01 18:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-01 12:43 [PATCH] fs/eventpoll: error handling micro-cleanup Jeff Garzik
2006-10-01 16:04 ` Davide Libenzi
2006-10-01 16:08   ` Jeff Garzik
2006-10-01 16:19     ` Davide Libenzi
2006-10-01 16:30       ` Jeff Garzik
2006-10-01 16:41         ` Davide Libenzi
2006-10-01 17:28           ` Jeff Garzik
2006-10-01 18:58             ` Davide Libenzi

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.