mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Colin Ian King <colin.i.king@gmail.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
	linux-fsdevel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] fs/direct-io: remove redundant assignment to variable retval
Date: Wed, 10 Apr 2024 19:45:03 +0200	[thread overview]
Message-ID: <20240410174503.wycdhqsglx4pms4q@quack3> (raw)
In-Reply-To: <20240410162221.292485-1-colin.i.king@gmail.com>

On Wed 10-04-24 17:22:21, Colin Ian King wrote:
> The variable retval is being assigned a value that is not being read,
> it is being re-assigned later on in the function. The assignment
> is redundant and can be removed.
> 
> Cleans up clang scan build warning:
> fs/direct-io.c:1220:2: warning: Value stored to 'retval' is never
> read [deadcode.DeadStores]
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Indeed it's assigned a few lines below. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/direct-io.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/fs/direct-io.c b/fs/direct-io.c
> index 62c97ff9e852..b0aafe640fa4 100644
> --- a/fs/direct-io.c
> +++ b/fs/direct-io.c
> @@ -1217,7 +1217,6 @@ ssize_t __blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
>  	 */
>  	inode_dio_begin(inode);
>  
> -	retval = 0;
>  	sdio.blkbits = blkbits;
>  	sdio.blkfactor = i_blkbits - blkbits;
>  	sdio.block_in_file = offset >> blkbits;
> -- 
> 2.39.2
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2024-04-10 17:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-10 16:22 Colin Ian King
2024-04-10 17:45 ` Jan Kara [this message]
2024-04-11  8:21 ` Christian Brauner

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=20240410174503.wycdhqsglx4pms4q@quack3 \
    --to=jack@suse.cz \
    --cc=brauner@kernel.org \
    --cc=colin.i.king@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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

all inboxes | Powered by JetHome®