linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] aio: remove redundant check in ioctx_alloc()
@ 2019-01-04 14:31 Chengguang Xu
  2019-01-04 16:03 ` Jeff Moyer
  0 siblings, 1 reply; 2+ messages in thread
From: Chengguang Xu @ 2019-01-04 14:31 UTC (permalink / raw)
  To: bcrl, viro; +Cc: linux-aio, linux-fsdevel, Chengguang Xu

We don't have to check if nr_events is zero in
ioctx_alloc() because the caller has already
done that.

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
---
 fs/aio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/aio.c b/fs/aio.c
index b906ff70c90f..7b26c4feb0de 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -720,7 +720,7 @@ static struct kioctx *ioctx_alloc(unsigned nr_events)
 		return ERR_PTR(-EINVAL);
 	}
 
-	if (!nr_events || (unsigned long)max_reqs > aio_max_nr)
+	if ((unsigned long)max_reqs > aio_max_nr)
 		return ERR_PTR(-EAGAIN);
 
 	ctx = kmem_cache_zalloc(kioctx_cachep, GFP_KERNEL);
-- 
2.17.2

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

end of thread, other threads:[~2019-01-04 16:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-04 14:31 [PATCH] aio: remove redundant check in ioctx_alloc() Chengguang Xu
2019-01-04 16:03 ` Jeff Moyer

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).