From dd854e4b5b12016d27bfa2694226a1c15acbd640 Mon Sep 17 00:00:00 2001 From: Kari Argillander Date: Wed, 25 Aug 2021 21:25:22 +0300 Subject: [Backport dd854e4b5b12] src: Remove unnecessary condition checking from ntfs_file_read_iter 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 src/file.c:803 ntfs_file_read_iter() warn: unused return: count = iov_iter_count() Signed-off-by: Kari Argillander Signed-off-by: Konstantin Komarov --- src/file.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/file.c b/src/file.c index f9c9a8c91b46d6fad597c954c3b4a2cd331ebfb6..424450e77ad52ae550e8de444dc393411d97cde6 100644 --- a/src/file.c +++ b/src/file.c @@ -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); @@ -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); } /* -- 2.31.1