linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs: eventfd - Removed redundant initialization of res in BLOCKing mode
@ 2012-04-19 14:34 Sasikantha babu
  0 siblings, 0 replies; only message in thread
From: Sasikantha babu @ 2012-04-19 14:34 UTC (permalink / raw)
  To: Alexander Viro; +Cc: linux-fsdevel, linux-kernel, Sasikantha babu

Removed redundant initialization of res to 0, since eventfd_write in 
blocking mode guarantees res to be either sizeof(ucnt) or -ERESTARTSYS.

Signed-off-by: Sasikantha babu <sasikanth.v19@gmail.com>
---
 fs/eventfd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/eventfd.c b/fs/eventfd.c
index dba15fe..6bd051c 100644
--- a/fs/eventfd.c
+++ b/fs/eventfd.c
@@ -261,7 +261,7 @@ static ssize_t eventfd_write(struct file *file, const char __user *buf, size_t c
 		res = sizeof(ucnt);
 	else if (!(file->f_flags & O_NONBLOCK)) {
 		__add_wait_queue(&ctx->wqh, &wait);
-		for (res = 0;;) {
+		for (;;) {
 			set_current_state(TASK_INTERRUPTIBLE);
 			if (ULLONG_MAX - ctx->count > ucnt) {
 				res = sizeof(ucnt);
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-04-19 14:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-19 14:34 [PATCH] fs: eventfd - Removed redundant initialization of res in BLOCKing mode Sasikantha babu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).