From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: [PATCH] aio: remove 'always false' check Date: Wed, 11 Jul 2012 17:15:22 +0800 Message-ID: <1341998122-9521-1-git-send-email-yuanhan.liu@linux.intel.com> Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, Yuanhan Liu To: bcrl@kvack.org Return-path: Received: from mga14.intel.com ([143.182.124.37]:56237 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752131Ab2GKJO6 (ORCPT ); Wed, 11 Jul 2012 05:14:58 -0400 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 --- 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