Skip to content

Commit

Permalink
fs/ntfs3: Remove unnecessary condition checking from ntfs_file_read_iter
Browse files Browse the repository at this point in the history
This check will be also performed in generic_file_read_iter() so we do
not want to check this two times in a row.

This was founded with Smatch
	fs/ntfs3/file.c:803 ntfs_file_read_iter()
	warn: unused return: count = iov_iter_count()

Signed-off-by: Kari Argillander <kari.argillander@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
  • Loading branch information
teksturi authored and aalexandrovich committed Sep 2, 2021
1 parent d4e8e13 commit dd854e4
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions fs/ntfs3/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -793,8 +793,6 @@ int ntfs3_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,

static ssize_t ntfs_file_read_iter(struct kiocb *iocb, struct iov_iter *iter)
{
ssize_t err;
size_t count = iov_iter_count(iter);
struct file *file = iocb->ki_filp;
struct inode *inode = file->f_mapping->host;
struct ntfs_inode *ni = ntfs_i(inode);
Expand Down Expand Up @@ -823,9 +821,7 @@ static ssize_t ntfs_file_read_iter(struct kiocb *iocb, struct iov_iter *iter)
return -EOPNOTSUPP;
}

err = count ? generic_file_read_iter(iocb, iter) : 0;

return err;
return generic_file_read_iter(iocb, iter);
}

/*
Expand Down

0 comments on commit dd854e4

Please sign in to comment.