2019-07-04 13:31:38

by Colin King

[permalink] [raw]
Subject: [PATCH] staging: greybus: remove redundant assignment to variable is_empty

From: Colin Ian King <[email protected]>

The variable is_empty is being initialized with a value that is never
read and it is being updated later with a new value. The
initialization is redundant and can be removed.

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

diff --git a/drivers/staging/greybus/audio_manager.c b/drivers/staging/greybus/audio_manager.c
index c2a4af4c1d06..9b19ea9d3fa1 100644
--- a/drivers/staging/greybus/audio_manager.c
+++ b/drivers/staging/greybus/audio_manager.c
@@ -86,7 +86,7 @@ EXPORT_SYMBOL_GPL(gb_audio_manager_remove);
void gb_audio_manager_remove_all(void)
{
struct gb_audio_manager_module *module, *next;
- int is_empty = 1;
+ int is_empty;

down_write(&modules_rwsem);

--
2.20.1


2019-07-04 15:56:32

by Mark Greer

[permalink] [raw]
Subject: Re: [PATCH] staging: greybus: remove redundant assignment to variable is_empty

On Thu, Jul 04, 2019 at 02:30:31PM +0100, Colin King wrote:
> From: Colin Ian King <[email protected]>
>
> The variable is_empty is being initialized with a value that is never
> read and it is being updated later with a new value. The
> initialization is redundant and can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <[email protected]>
> ---
> drivers/staging/greybus/audio_manager.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/greybus/audio_manager.c b/drivers/staging/greybus/audio_manager.c
> index c2a4af4c1d06..9b19ea9d3fa1 100644
> --- a/drivers/staging/greybus/audio_manager.c
> +++ b/drivers/staging/greybus/audio_manager.c
> @@ -86,7 +86,7 @@ EXPORT_SYMBOL_GPL(gb_audio_manager_remove);
> void gb_audio_manager_remove_all(void)
> {
> struct gb_audio_manager_module *module, *next;
> - int is_empty = 1;
> + int is_empty;
>
> down_write(&modules_rwsem);

Reviewed-by: Mark Greer <[email protected]>

2019-07-04 16:12:42

by Vaibhav Agarwal

[permalink] [raw]
Subject: Re: [PATCH] staging: greybus: remove redundant assignment to variable is_empty

On Thu, Jul 4, 2019 at 7:00 PM Colin King <[email protected]> wrote:
>
> From: Colin Ian King <[email protected]>
>
> The variable is_empty is being initialized with a value that is never
> read and it is being updated later with a new value. The
> initialization is redundant and can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <[email protected]>
> ---
> drivers/staging/greybus/audio_manager.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/greybus/audio_manager.c b/drivers/staging/greybus/audio_manager.c
> index c2a4af4c1d06..9b19ea9d3fa1 100644
> --- a/drivers/staging/greybus/audio_manager.c
> +++ b/drivers/staging/greybus/audio_manager.c
> @@ -86,7 +86,7 @@ EXPORT_SYMBOL_GPL(gb_audio_manager_remove);
> void gb_audio_manager_remove_all(void)
> {
> struct gb_audio_manager_module *module, *next;
> - int is_empty = 1;
> + int is_empty;
>
> down_write(&modules_rwsem);
>
> --
> 2.20.1
>
Reviewed-by: Vaibhav Agarwal <[email protected]>