From patchwork Mon Sep 28 14:53:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yaowei Bai X-Patchwork-Id: 7278301 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5038F9F302 for ; Mon, 28 Sep 2015 14:56:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7C5982073C for ; Mon, 28 Sep 2015 14:56:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 98BFB20588 for ; Mon, 28 Sep 2015 14:56:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933685AbbI1Oz5 (ORCPT ); Mon, 28 Sep 2015 10:55:57 -0400 Received: from m12-13.163.com ([220.181.12.13]:56819 "EHLO m12-13.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933556AbbI1Oz4 (ORCPT ); Mon, 28 Sep 2015 10:55:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=QUNhGmvnuaWxWvpiOO 658O95KvXc0/q/FbDFYJ48UdI=; b=i6lrkneWxlTLY1av34lH4XbWb4cVB9yaw/ AsNqmcV9mQPnyYk/r3Q/gX/tfRNs0z9In3t+HQXposYGSCmNqNWMiy/I+DC9Aijn Z3bP1k+OvK08qC4ICVRb/3w6znrm/NbrJc4N/gBWvi7t2rN2vNWFyu7xqDcv/79r 0nyoJTh/Q= Received: from localhost.localdomain (unknown [58.209.166.48]) by smtp9 (Coremail) with SMTP id DcCowADnMEncVAlWuw_SCw--.4979S3; Mon, 28 Sep 2015 22:55:26 +0800 (CST) From: Yaowei Bai To: viro@zeniv.linux.org.uk, dedekind1@gmail.com, adrian.hunter@intel.com Cc: linux-mtd@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 17/17] fs/ubifs: remove unnecessary new_valid_dev check Date: Mon, 28 Sep 2015 22:53:24 +0800 Message-Id: <1443452004-5831-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: DcCowADnMEncVAlWuw_SCw--.4979S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7ur1DZw45uFW5XFyDXrykGrg_yoW8JFWUpF WrKa4rJryrG3yDKan0vr1rGa1UWFnaga45uws093WIq39xAa17tr1rtryFvryFyFW0yFW8 Zr4UCa1UWr4rXaUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jaxRgUUUUU= X-Originating-IP: [58.209.166.48] X-CM-SenderInfo: xe1z5x5dretxi6rwjhhfrp/1tbiUB6DT1WBQU2JHwAAsM 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/ubifs/dir.c | 3 --- fs/ubifs/misc.h | 9 ++------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index 5c27c66..1dd9267 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@ -787,9 +787,6 @@ static int ubifs_mknod(struct inode *dir, struct dentry *dentry, dbg_gen("dent '%pd' in dir ino %lu", dentry, dir->i_ino); - if (!new_valid_dev(rdev)) - return -EINVAL; - if (S_ISBLK(mode) || S_ISCHR(mode)) { dev = kmalloc(sizeof(union ubifs_dev_desc), GFP_NOFS); if (!dev) diff --git a/fs/ubifs/misc.h b/fs/ubifs/misc.h index ee7cb5e..0197ed6 100644 --- a/fs/ubifs/misc.h +++ b/fs/ubifs/misc.h @@ -155,13 +155,8 @@ static inline int ubifs_wbuf_sync(struct ubifs_wbuf *wbuf) */ static inline int ubifs_encode_dev(union ubifs_dev_desc *dev, dev_t rdev) { - if (new_valid_dev(rdev)) { - dev->new = cpu_to_le32(new_encode_dev(rdev)); - return sizeof(dev->new); - } else { - dev->huge = cpu_to_le64(huge_encode_dev(rdev)); - return sizeof(dev->huge); - } + dev->huge = cpu_to_le64(huge_encode_dev(rdev)); + return sizeof(dev->huge); } /**