]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
fs/ubifs/: remove unnecessary new_valid_dev() checks
authorYaowei Bai <bywxiaobai@163.com>
Wed, 21 Oct 2015 22:13:28 +0000 (09:13 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 5 Nov 2015 05:11:49 +0000 (16:11 +1100)
new_valid_dev() always returns 1, so the !new_valid_dev() checks are not
needed.  Remove them.

Signed-off-by: Yaowei Bai <bywxiaobai@163.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Acked-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ubifs/dir.c
fs/ubifs/misc.h

index 5c27c66c224af38618ec4f92b453bd8e65d24608..1dd9267c165bade5e2e0d7de25ff95d4cb99586e 100644 (file)
@@ -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)
index ee7cb5ebb6e8910f851469bce4dcb205785cb85c..8ece6ca58c0ba128f658ea0c42ddc7976d942314 100644 (file)
@@ -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->new = cpu_to_le32(new_encode_dev(rdev));
+       return sizeof(dev->new);
 }
 
 /**