* [PATCH] ceph: remove redundant assignment to variable i
@ 2020-12-04 18:54 Colin King
2020-12-08 12:34 ` Jeff Layton
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2020-12-04 18:54 UTC (permalink / raw)
To: Jeff Layton, Ilya Dryomov, ceph-devel; +Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The variable i is being initialized with a value that is never read
and it is being updated later with a new value in a for-loop. The
initialization is redundant and can be removed.
Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
fs/ceph/mds_client.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 8f1d7500a7ec..b70937caa7a7 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -1243,7 +1243,7 @@ static struct ceph_msg *create_session_open_msg(struct ceph_mds_client *mdsc, u6
{
struct ceph_msg *msg;
struct ceph_mds_session_head *h;
- int i = -1;
+ int i;
int extra_bytes = 0;
int metadata_key_count = 0;
struct ceph_options *opt = mdsc->fsc->client->options;
--
2.29.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ceph: remove redundant assignment to variable i
2020-12-04 18:54 [PATCH] ceph: remove redundant assignment to variable i Colin King
@ 2020-12-08 12:34 ` Jeff Layton
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Layton @ 2020-12-08 12:34 UTC (permalink / raw)
To: Colin King, Ilya Dryomov, ceph-devel; +Cc: kernel-janitors, linux-kernel
On Fri, 2020-12-04 at 18:54 +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable i is being initialized with a value that is never read
> and it is being updated later with a new value in a for-loop. The
> initialization is redundant and can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> fs/ceph/mds_client.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> index 8f1d7500a7ec..b70937caa7a7 100644
> --- a/fs/ceph/mds_client.c
> +++ b/fs/ceph/mds_client.c
> @@ -1243,7 +1243,7 @@ static struct ceph_msg *create_session_open_msg(struct ceph_mds_client *mdsc, u6
> {
> struct ceph_msg *msg;
> struct ceph_mds_session_head *h;
> - int i = -1;
> + int i;
> int extra_bytes = 0;
> int metadata_key_count = 0;
> struct ceph_options *opt = mdsc->fsc->client->options;
Meh, ok. Merged into ceph-client/testing branch. It should make v5.11.
Thanks,
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-08 12:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04 18:54 [PATCH] ceph: remove redundant assignment to variable i Colin King
2020-12-08 12:34 ` Jeff Layton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).