diff mbox series

acpi: tcpa: remove redundant initialization of boolean passed

Message ID 20190610115915.30053-1-colin.king@canonical.com
State Accepted
Headers show
Series acpi: tcpa: remove redundant initialization of boolean passed | expand

Commit Message

Colin Ian King June 10, 2019, 11:59 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The variable passed is being initialized however that value is never
read because it is being re-assigned on various code paths that
follow it.  Hence the initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpi/tcpa/tcpa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alex Hung June 10, 2019, 8:31 p.m. UTC | #1
On 2019-06-10 4:59 a.m., Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable passed is being initialized however that value is never
> read because it is being re-assigned on various code paths that
> follow it.  Hence the initialization is redundant and can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/acpi/tcpa/tcpa.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/acpi/tcpa/tcpa.c b/src/acpi/tcpa/tcpa.c
> index 39ba6f7b..b662a854 100644
> --- a/src/acpi/tcpa/tcpa.c
> +++ b/src/acpi/tcpa/tcpa.c
> @@ -171,7 +171,7 @@ static int tcpa_server_test(fwts_framework *fw, fwts_acpi_table_tcpa *tcpa)
>  static int tcpa_test1(fwts_framework *fw)
>  {
>  	fwts_acpi_table_tcpa *tcpa = (fwts_acpi_table_tcpa*)table->data;
> -	bool passed = true;
> +	bool passed;
>  
>  	switch (tcpa->platform_class) {
>  	case 0:
> 


Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan Hu June 11, 2019, 5:46 a.m. UTC | #2
On 6/10/19 7:59 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable passed is being initialized however that value is never
> read because it is being re-assigned on various code paths that
> follow it.  Hence the initialization is redundant and can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/acpi/tcpa/tcpa.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/acpi/tcpa/tcpa.c b/src/acpi/tcpa/tcpa.c
> index 39ba6f7b..b662a854 100644
> --- a/src/acpi/tcpa/tcpa.c
> +++ b/src/acpi/tcpa/tcpa.c
> @@ -171,7 +171,7 @@ static int tcpa_server_test(fwts_framework *fw, fwts_acpi_table_tcpa *tcpa)
>  static int tcpa_test1(fwts_framework *fw)
>  {
>  	fwts_acpi_table_tcpa *tcpa = (fwts_acpi_table_tcpa*)table->data;
> -	bool passed = true;
> +	bool passed;
>  
>  	switch (tcpa->platform_class) {
>  	case 0:


Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox series

Patch

diff --git a/src/acpi/tcpa/tcpa.c b/src/acpi/tcpa/tcpa.c
index 39ba6f7b..b662a854 100644
--- a/src/acpi/tcpa/tcpa.c
+++ b/src/acpi/tcpa/tcpa.c
@@ -171,7 +171,7 @@  static int tcpa_server_test(fwts_framework *fw, fwts_acpi_table_tcpa *tcpa)
 static int tcpa_test1(fwts_framework *fw)
 {
 	fwts_acpi_table_tcpa *tcpa = (fwts_acpi_table_tcpa*)table->data;
-	bool passed = true;
+	bool passed;
 
 	switch (tcpa->platform_class) {
 	case 0: