All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] aio: remove 'always false' check
@ 2012-07-11  9:15 Yuanhan Liu
  2012-07-11 14:17 ` Jeff Moyer
  0 siblings, 1 reply; 3+ messages in thread
From: Yuanhan Liu @ 2012-07-11  9:15 UTC (permalink / raw)
  To: bcrl; +Cc: viro, linux-fsdevel, Yuanhan Liu

The only case that nr_pages will be < 0 is that nr_pages overflowed due
to nr_events is too big. But it is exclued at ioctx_alloc().

Thus, nr_pages will always > 0. So remove the dead 'if (nr_pages < 0)'
code block.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
---
 fs/aio.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/fs/aio.c b/fs/aio.c
index 55c4c76..7248327 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -117,10 +117,6 @@ static int aio_setup_ring(struct kioctx *ctx)
 	size = sizeof(struct aio_ring);
 	size += sizeof(struct io_event) * nr_events;
 	nr_pages = (size + PAGE_SIZE-1) >> PAGE_SHIFT;
-
-	if (nr_pages < 0)
-		return -EINVAL;
-
 	nr_events = (PAGE_SIZE * nr_pages - sizeof(struct aio_ring)) / sizeof(struct io_event);
 
 	info->nr = 0;
-- 
1.7.7.6


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

end of thread, other threads:[~2012-07-13  1:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-11  9:15 [PATCH] aio: remove 'always false' check Yuanhan Liu
2012-07-11 14:17 ` Jeff Moyer
2012-07-13  1:35   ` Yuanhan Liu

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.