diff mbox series

ceph: remove redundant variable ino

Message ID 20220518085508.509104-1-colin.i.king@gmail.com (mailing list archive)
State New, archived
Headers show
Series ceph: remove redundant variable ino | expand

Commit Message

Colin Ian King May 18, 2022, 8:55 a.m. UTC
Variable ino is being assigned a value that is never read. The variable
and assignment are redundant, remove it.

Cleans up clang scan build warning:
warning: Although the value stored to 'ino' is used in the enclosing
expression, the value is never actually read from 'ino'
[deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 fs/ceph/mds_client.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jeffrey Layton May 18, 2022, 2:08 p.m. UTC | #1
On Wed, 2022-05-18 at 09:55 +0100, Colin Ian King wrote:
> Variable ino is being assigned a value that is never read. The variable
> and assignment are redundant, remove it.
> 
> Cleans up clang scan build warning:
> warning: Although the value stored to 'ino' is used in the enclosing
> expression, the value is never actually read from 'ino'
> [deadcode.DeadStores]
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>  fs/ceph/mds_client.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> index 00c3de177dd6..20197f05faec 100644
> --- a/fs/ceph/mds_client.c
> +++ b/fs/ceph/mds_client.c
> @@ -437,7 +437,7 @@ static int ceph_parse_deleg_inos(void **p, void *end,
>  	ceph_decode_32_safe(p, end, sets, bad);
>  	dout("got %u sets of delegated inodes\n", sets);
>  	while (sets--) {
> -		u64 start, len, ino;
> +		u64 start, len;
>  
>  		ceph_decode_64_safe(p, end, start, bad);
>  		ceph_decode_64_safe(p, end, len, bad);
> @@ -449,7 +449,7 @@ static int ceph_parse_deleg_inos(void **p, void *end,
>  			continue;
>  		}
>  		while (len--) {
> -			int err = xa_insert(&s->s_delegated_inos, ino = start++,
> +			int err = xa_insert(&s->s_delegated_inos, start++,
>  					    DELEGATED_INO_AVAILABLE,
>  					    GFP_KERNEL);
>  			if (!err) {

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Xiubo Li May 18, 2022, 2:23 p.m. UTC | #2
On 5/18/22 4:55 PM, Colin Ian King wrote:
> Variable ino is being assigned a value that is never read. The variable
> and assignment are redundant, remove it.
>
> Cleans up clang scan build warning:
> warning: Although the value stored to 'ino' is used in the enclosing
> expression, the value is never actually read from 'ino'
> [deadcode.DeadStores]
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>   fs/ceph/mds_client.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> index 00c3de177dd6..20197f05faec 100644
> --- a/fs/ceph/mds_client.c
> +++ b/fs/ceph/mds_client.c
> @@ -437,7 +437,7 @@ static int ceph_parse_deleg_inos(void **p, void *end,
>   	ceph_decode_32_safe(p, end, sets, bad);
>   	dout("got %u sets of delegated inodes\n", sets);
>   	while (sets--) {
> -		u64 start, len, ino;
> +		u64 start, len;
>   
>   		ceph_decode_64_safe(p, end, start, bad);
>   		ceph_decode_64_safe(p, end, len, bad);
> @@ -449,7 +449,7 @@ static int ceph_parse_deleg_inos(void **p, void *end,
>   			continue;
>   		}
>   		while (len--) {
> -			int err = xa_insert(&s->s_delegated_inos, ino = start++,
> +			int err = xa_insert(&s->s_delegated_inos, start++,
>   					    DELEGATED_INO_AVAILABLE,
>   					    GFP_KERNEL);
>   			if (!err) {

Merged into ceph-client/testing branch. Thanks!

-- Xiubo
diff mbox series

Patch

diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 00c3de177dd6..20197f05faec 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -437,7 +437,7 @@  static int ceph_parse_deleg_inos(void **p, void *end,
 	ceph_decode_32_safe(p, end, sets, bad);
 	dout("got %u sets of delegated inodes\n", sets);
 	while (sets--) {
-		u64 start, len, ino;
+		u64 start, len;
 
 		ceph_decode_64_safe(p, end, start, bad);
 		ceph_decode_64_safe(p, end, len, bad);
@@ -449,7 +449,7 @@  static int ceph_parse_deleg_inos(void **p, void *end,
 			continue;
 		}
 		while (len--) {
-			int err = xa_insert(&s->s_delegated_inos, ino = start++,
+			int err = xa_insert(&s->s_delegated_inos, start++,
 					    DELEGATED_INO_AVAILABLE,
 					    GFP_KERNEL);
 			if (!err) {