diff mbox series

acpi: s3power: clean up pedantic static analysis warnings

Message ID 20210922085959.115393-1-colin.king@canonical.com
State Accepted
Headers show
Series acpi: s3power: clean up pedantic static analysis warnings | expand

Commit Message

Colin Ian King Sept. 22, 2021, 8:59 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Static analysis is warning that variable status may be uninitialized.
Clean this up by setting the variable to FWTS_OK.

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

Comments

Alex Hung Sept. 22, 2021, 7:06 p.m. UTC | #1
On 2021-09-22 2:59 a.m., Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Static analysis is warning that variable status may be uninitialized.
> Clean this up by setting the variable to FWTS_OK.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/acpi/s3power/s3power.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/acpi/s3power/s3power.c b/src/acpi/s3power/s3power.c
> index f47ff8bb..4633ef30 100644
> --- a/src/acpi/s3power/s3power.c
> +++ b/src/acpi/s3power/s3power.c
> @@ -176,7 +176,7 @@ static int wrap_pmutils_do_suspend(fwts_pm_method_vars *fwts_settings,
>  	int *duration,
>  	const char *command)
>  {
> -	int status;
> +	int status = FWTS_OK;
>  
>  	fwts_progress_message(fwts_settings->fw, percent, "(Suspending)");
>  	time(&(fwts_settings->t_start));
> 

Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan Hu Sept. 23, 2021, 3 a.m. UTC | #2
On 9/22/21 4:59 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Static analysis is warning that variable status may be uninitialized.
> Clean this up by setting the variable to FWTS_OK.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/acpi/s3power/s3power.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/acpi/s3power/s3power.c b/src/acpi/s3power/s3power.c
> index f47ff8bb..4633ef30 100644
> --- a/src/acpi/s3power/s3power.c
> +++ b/src/acpi/s3power/s3power.c
> @@ -176,7 +176,7 @@ static int wrap_pmutils_do_suspend(fwts_pm_method_vars *fwts_settings,
>  	int *duration,
>  	const char *command)
>  {
> -	int status;
> +	int status = FWTS_OK;
>  
>  	fwts_progress_message(fwts_settings->fw, percent, "(Suspending)");
>  	time(&(fwts_settings->t_start));
> 

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

Patch

diff --git a/src/acpi/s3power/s3power.c b/src/acpi/s3power/s3power.c
index f47ff8bb..4633ef30 100644
--- a/src/acpi/s3power/s3power.c
+++ b/src/acpi/s3power/s3power.c
@@ -176,7 +176,7 @@  static int wrap_pmutils_do_suspend(fwts_pm_method_vars *fwts_settings,
 	int *duration,
 	const char *command)
 {
-	int status;
+	int status = FWTS_OK;
 
 	fwts_progress_message(fwts_settings->fw, percent, "(Suspending)");
 	time(&(fwts_settings->t_start));