From patchwork Mon Sep 28 13:34:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yaowei Bai X-Patchwork-Id: 7277661 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D7DC8BEEA4 for ; Mon, 28 Sep 2015 13:37:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0890C2075F for ; Mon, 28 Sep 2015 13:37:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2C0692075A for ; Mon, 28 Sep 2015 13:37:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933393AbbI1NhT (ORCPT ); Mon, 28 Sep 2015 09:37:19 -0400 Received: from m12-14.163.com ([220.181.12.14]:40803 "EHLO m12-14.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755091AbbI1NhS (ORCPT ); Mon, 28 Sep 2015 09:37:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=SbxOklvvIrl5STb5t9 FTreiEUnVgzjA39M/reJRiT1Y=; b=IgFb8fAvKNIXJeaxG8r8MOClOOR0XfRoS7 UYNNFGkrRTzcysjoyRpj1zG0PunA5nioJ4Stef/HcfmET+hzO3kJO/7NuotaLvyU kGgPPE8EBQTHsFdLiaEvv+08VxZp7v/LKGK2sW3OsY3jYa0ccRILSzcd5KQnfk2f GhuFD/bUg= Received: from localhost.localdomain (unknown [58.209.166.48]) by smtp10 (Coremail) with SMTP id DsCowEDpYWl2QglWCXAxDA--.39032S3; Mon, 28 Sep 2015 21:36:55 +0800 (CST) From: Yaowei Bai To: viro@zeniv.linux.org.uk, ericvh@gmail.com, rminnich@sandia.gov, lucho@ionkov.net Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/17] fs/vfs: remove unnecessary new_valid_dev check Date: Mon, 28 Sep 2015 21:34:55 +0800 Message-Id: <1443447295-5009-1-git-send-email-bywxiaobai@163.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1443446807-4838-1-git-send-email-bywxiaobai@163.com> References: <1443446807-4838-1-git-send-email-bywxiaobai@163.com> X-CM-TRANSID: DsCowEDpYWl2QglWCXAxDA--.39032S3 X-Coremail-Antispam: 1Uf129KBjvdXoWrKrWUury3tFyUGw15tFW8JFb_yoWktrbEkF y5uF4vgrW3Xwn5AFZ8Cr13ArZ3A3Zak343W398tryUta47tF1DJrZ8tFsIyFW8W398Xas8 uF9akr1rGry8GjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUnna93UUUUU== X-Originating-IP: [58.209.166.48] X-CM-SenderInfo: xe1z5x5dretxi6rwjhhfrp/1tbiuxmDT1O-wU0T8gAAsv Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As new_valid_dev always returns 1, so !new_valid_dev check is not needed, remove it. Signed-off-by: Yaowei Bai --- fs/9p/vfs_inode.c | 3 --- fs/9p/vfs_inode_dotl.c | 3 --- 2 files changed, 6 deletions(-) diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index b1dc518..699941e 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -1368,9 +1368,6 @@ v9fs_vfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rde dir->i_ino, dentry, mode, MAJOR(rdev), MINOR(rdev)); - if (!new_valid_dev(rdev)) - return -EINVAL; - /* build extension */ if (S_ISBLK(mode)) sprintf(name, "b %u %u", MAJOR(rdev), MINOR(rdev)); diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c index e8aa57d..cb899af 100644 --- a/fs/9p/vfs_inode_dotl.c +++ b/fs/9p/vfs_inode_dotl.c @@ -829,9 +829,6 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, umode_t omode, dir->i_ino, dentry, omode, MAJOR(rdev), MINOR(rdev)); - if (!new_valid_dev(rdev)) - return -EINVAL; - v9ses = v9fs_inode2v9ses(dir); dir_dentry = dentry->d_parent; dfid = v9fs_fid_lookup(dir_dentry);