[PATCH] aio: remove 'always false' check

DORMANTno replies

From: Yuanhan Liu <hidden>
Date: 2012-07-11 09:14:58
Subsystem: aio, filesystems (vfs and infrastructure), the rest · Maintainers: Benjamin LaHaise, Alexander Viro, Christian Brauner, Linus Torvalds

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help