2021-06-13 13:53:10

by Colin King

[permalink] [raw]
Subject: [PATCH] ocfs2: remove redundant initialization of variable ret

From: Colin Ian King <[email protected]>

The variable ret is being initialized with a value that is never read, the
assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <[email protected]>
---
fs/ocfs2/cluster/nodemanager.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ocfs2/cluster/nodemanager.c b/fs/ocfs2/cluster/nodemanager.c
index bb82e6b1ff4e..625c92521416 100644
--- a/fs/ocfs2/cluster/nodemanager.c
+++ b/fs/ocfs2/cluster/nodemanager.c
@@ -824,7 +824,7 @@ static void __exit exit_o2nm(void)

static int __init init_o2nm(void)
{
- int ret = -1;
+ int ret;

o2hb_init();

--
2.31.1


2021-06-15 02:53:46

by Joseph Qi

[permalink] [raw]
Subject: Re: [PATCH] ocfs2: remove redundant initialization of variable ret



On 6/13/21 9:51 PM, Colin King wrote:
> From: Colin Ian King <[email protected]>
>
> The variable ret is being initialized with a value that is never read, the
> assignment is redundant and can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <[email protected]>

Acked-by: Joseph Qi <[email protected]>
> ---
> fs/ocfs2/cluster/nodemanager.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ocfs2/cluster/nodemanager.c b/fs/ocfs2/cluster/nodemanager.c
> index bb82e6b1ff4e..625c92521416 100644
> --- a/fs/ocfs2/cluster/nodemanager.c
> +++ b/fs/ocfs2/cluster/nodemanager.c
> @@ -824,7 +824,7 @@ static void __exit exit_o2nm(void)
>
> static int __init init_o2nm(void)
> {
> - int ret = -1;
> + int ret;
>
> o2hb_init();
>
>