From patchwork Sun Jun 12 16:33:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minfei Huang X-Patchwork-Id: 9171559 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 659DE6044F for ; Sun, 12 Jun 2016 16:34:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4516C20265 for ; Sun, 12 Jun 2016 16:34:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27D3B25D99; Sun, 12 Jun 2016 16:34:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7D4920265 for ; Sun, 12 Jun 2016 16:34:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752083AbcFLQeI (ORCPT ); Sun, 12 Jun 2016 12:34:08 -0400 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 Received: by mail-pf0-f195.google.com with SMTP id 66so6998637pfy.1; Sun, 12 Jun 2016 09:34:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=eoyTyI+e5GEskKQlBWKkaeCYvbzAph4Dyo3mjDseUZY=; b=yd7vhtIzCZ4XNFJdHWbK6ng51fyfiMMc6b3h35aFnaIHWyLkVcsAiziRoyiqZEgj3D GoDx2u63uRSGtmqqFxQiudmse8t8lxhIx0cKwGia6J06W2WBBRIGBtAecNSB1JAkon2w XT/PWjtZIXXi1KebsurPj0IAskIF4PCLfSOIZH65O/uCruMJpblQGG6S8ifOo8zB/T/X e1PdThQdm/I5YS4kkSmeUz3ivc2EC+lTNAYYJ3U9ibJL9Etaf82v9TIMP36SPfO0RVUv tMrB6ggQ4vht7ElIt4ZMMZjqflkDRnh2EZVf9EXlPqOl3kAsDGtRUrLkkwXEYBrZCl0Z EkMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=eoyTyI+e5GEskKQlBWKkaeCYvbzAph4Dyo3mjDseUZY=; b=N+FAeEXB5XahUV/iechUlkIp5OUAYsjy3W+y7J2rEWISEB33LNxN3aa/H17GjTAp2g 6A9kdjQbuxtRKEw3OL6pZ8ZaIxa5/sIqDPMGDQ0um2CsynGno/KagvvPIkLSCOuhxNql ULFRlPecJopSJ1W1shrsiDfi/ux1UggaWfc68LrLZc/v1OV7EqKJsWseW0Tc48Yu3WsT T/1qBivFQJJJE2j695YVo1mpPoXIsn5ckT+WhZk75O4ue1BgDbHNidMnBJrqH7X0u3fr Z6MKJkXMcj51M0HFBJbDdzekLEs6x4KyA7S+9GKBObJribsPMWti/iRpEizXm4ufZAAt y/RA== X-Gm-Message-State: ALyK8tKcjMZRQZ5IdH9NhB/vto7Rqwr8N7h0xKrhyel0stUI8ReR7AeVfWOF1fWz1QAGvw== X-Received: by 10.98.18.131 with SMTP id 3mr16383975pfs.102.1465749245654; Sun, 12 Jun 2016 09:34:05 -0700 (PDT) Received: from localhost ([202.91.178.178]) by smtp.gmail.com with ESMTPSA id tb7sm31372975pab.21.2016.06.12.09.34.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Jun 2016 09:34:05 -0700 (PDT) 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> X-Mailer: git-send-email 2.7.4 (Apple Git-66) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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)) {