Skip to content

Commit

Permalink
fs/ubifs: remove unnecessary new_valid_dev check
Browse files Browse the repository at this point in the history
As currently new_valid_dev always returns 1, so new_valid_dev check is not
needed, remove it.

Signed-off-by: Yaowei Bai <bywxiaobai@163.com>
Reviewed-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
  • Loading branch information
Yaowei Bai authored and Richard Weinberger committed Nov 6, 2015
1 parent 1cb8f97 commit 86ba9ed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
3 changes: 0 additions & 3 deletions fs/ubifs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 2 additions & 7 deletions fs/ubifs/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 86ba9ed

Please sign in to comment.