lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 10 Apr 2024 14:05:27 +0200
From: Jan Kara <jack@...e.cz>
To: Colin Ian King <colin.i.king@...il.com>
Cc: Theodore Ts'o <tytso@....edu>, Jan Kara <jack@...e.com>,
	linux-ext4@...r.kernel.org, kernel-janitors@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH][next] jbd2: remove redundant assignement to variable err

On Wed 10-04-24 12:28:03, Colin Ian King wrote:
> The variable err is being assigned a value that is never read, it
> is being re-assigned inside the following while loop and also
> after the while loop. The assignment is redundant and can be
> removed.
> 
> Cleans up clang scan build warning:
> fs/jbd2/commit.c:574:2: warning: Value stored to 'err' is never
> read [deadcode.DeadStores]
> 
> Signed-off-by: Colin Ian King <colin.i.king@...il.com>

OK, this assignment indeed looks redundant and is not even making code
easier to reason about. So feel free to add:

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

								Honza

> ---
>  fs/jbd2/commit.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
> index 5e122586e06e..78a9d08ae9f8 100644
> --- a/fs/jbd2/commit.c
> +++ b/fs/jbd2/commit.c
> @@ -571,7 +571,6 @@ void jbd2_journal_commit_transaction(journal_t *journal)
>  	J_ASSERT(commit_transaction->t_nr_buffers <=
>  		 atomic_read(&commit_transaction->t_outstanding_credits));
>  
> -	err = 0;
>  	bufs = 0;
>  	descriptor = NULL;
>  	while (commit_transaction->t_buffers) {
> -- 
> 2.39.2
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ