From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f195.google.com ([209.85.192.195]:34305 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750937AbcFLQeH (ORCPT ); Sun, 12 Jun 2016 12:34:07 -0400 From: Minfei Huang To: viro@zeniv.linux.org.uk, bcrl@kvack.org Cc: linux-fsdevel@vger.kernel.org, linux-aio@kvack.org, linux-kernel@vger.kernel.org, minfei.hmf@alibaba-inc.com, Minfei Huang Subject: [PATCH] aio: Cleanup unnecessary test for nr_pages Date: Mon, 13 Jun 2016 00:33:54 +0800 Message-Id: <1465749234-25746-1-git-send-email-mnghuan@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: The variable nr_pages is always more than 1, because the size of structure aio_ring is bigger than 0. So remove unnecessary test for nr_page. Signed-off-by: Minfei Huang --- fs/aio.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/aio.c b/fs/aio.c index fb8e45b..ec05137 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -450,8 +450,6 @@ static int aio_setup_ring(struct kioctx *ctx) size += sizeof(struct io_event) * nr_events; nr_pages = PFN_UP(size); - if (nr_pages < 0) - return -EINVAL; file = aio_private_file(ctx, nr_pages); if (IS_ERR(file)) { -- 2.7.4 (Apple Git-66)