From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754583AbcFTOGV (ORCPT ); Mon, 20 Jun 2016 10:06:21 -0400 Received: from mail-pa0-f68.google.com ([209.85.220.68]:34603 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754035AbcFTOGF (ORCPT ); Mon, 20 Jun 2016 10:06:05 -0400 Date: Mon, 20 Jun 2016 22:05:45 +0800 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 Subject: Re: [PATCH] aio: Cleanup unnecessary test for nr_pages Message-ID: <20160620140545.GA87874@MinfeideMacBook-Pro.local> References: <1465749234-25746-1-git-send-email-mnghuan@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1465749234-25746-1-git-send-email-mnghuan@gmail.com> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ping. Any comment is appreciate. Thanks Minfei On 06/13/16 at 12:33P, Minfei Huang wrote: > 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) >