public inbox for ntfs3@lists.linux.dev
 help / color / mirror / Atom feed
From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
To: Kari Argillander <kari.argillander@gmail.com>, <ntfs3@lists.linux.dev>
Cc: <linux-kernel@vger.kernel.org>, Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [PATCH] fs/ntfs3: Remove unnecessary condition checking from ntfs_file_read_iter
Date: Thu, 2 Sep 2021 19:26:26 +0300	[thread overview]
Message-ID: <cfd1ba66-ba28-274e-bd5e-e8525020cdc0@paragon-software.com> (raw)
In-Reply-To: <20210825182522.1367594-1-kari.argillander@gmail.com>



On 25.08.2021 21:25, Kari Argillander wrote:
> 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>
> ---
> I cc Dan also because I am happy that I finally managed to install
> Smack and straight away I found something with it. Thank you for
> this great tool.
> 
> Next step is to integrate Smack to CI system. But will probanly take
> a moment.
> ---
>  fs/ntfs3/file.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c
> index cb736701f2cc..5d41b84067ee 100644
> --- a/fs/ntfs3/file.c
> +++ b/fs/ntfs3/file.c
> @@ -799,8 +799,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);
> @@ -829,9 +827,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);
>  }
>  
>  /* returns array of locked pages */
> 

Applied, thanks!

      parent reply	other threads:[~2021-09-02 16:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25 18:25 [PATCH] fs/ntfs3: Remove unnecessary condition checking from ntfs_file_read_iter Kari Argillander
2021-08-25 19:17 ` Dan Carpenter
2021-08-25 19:31   ` Kari Argillander
2021-09-02 16:26 ` Konstantin Komarov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cfd1ba66-ba28-274e-bd5e-e8525020cdc0@paragon-software.com \
    --to=almaz.alexandrovich@paragon-software.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kari.argillander@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ntfs3@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox