Patchwork acpi: s3: remove redundant variable

login
register
mail settings
Submitter Colin King
Date Jan. 9, 2014, 3:17 p.m.
Message ID <1389280633-23779-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/308855/
State Accepted
Headers show

Comments

Colin King - Jan. 9, 2014, 3:17 p.m.
From: Colin Ian King <colin.king@canonical.com>

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpi/s3/s3.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
Ivan Hu - Jan. 13, 2014, 3:19 a.m.
On 01/09/2014 11:17 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/acpi/s3/s3.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/src/acpi/s3/s3.c b/src/acpi/s3/s3.c
> index bbb0497..6e1b4e4 100644
> --- a/src/acpi/s3/s3.c
> +++ b/src/acpi/s3/s3.c
> @@ -47,10 +47,8 @@ static float s3_resume_time = 15.0;	/* Maximum allowed resume time */
>
>   static int s3_init(fwts_framework *fw)
>   {
> -	int ret;
> -
>   	/* Pre-init - make sure wakealarm works so that we can wake up after suspend */
> -	if ((ret = fwts_wakealarm_test_firing(fw, 1))) {
> +	if (fwts_wakealarm_test_firing(fw, 1) != FWTS_OK) {
>   		fwts_log_error(fw, "Cannot automatically wake machine up - aborting S3 test.");
>   		fwts_failed(fw, LOG_LEVEL_MEDIUM, "BadWakeAlarmS3",
>   			"Check if wakealarm works reliably for S3 tests.");
>

Acked-by: Ivan Hu <ivan.hu@canonical.com>
Alex Hung - Jan. 14, 2014, 2:07 a.m.
On 01/09/2014 11:17 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/acpi/s3/s3.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/src/acpi/s3/s3.c b/src/acpi/s3/s3.c
> index bbb0497..6e1b4e4 100644
> --- a/src/acpi/s3/s3.c
> +++ b/src/acpi/s3/s3.c
> @@ -47,10 +47,8 @@ static float s3_resume_time = 15.0;	/* Maximum allowed resume time */
>  
>  static int s3_init(fwts_framework *fw)
>  {
> -	int ret;
> -
>  	/* Pre-init - make sure wakealarm works so that we can wake up after suspend */
> -	if ((ret = fwts_wakealarm_test_firing(fw, 1))) {
> +	if (fwts_wakealarm_test_firing(fw, 1) != FWTS_OK) {
>  		fwts_log_error(fw, "Cannot automatically wake machine up - aborting S3 test.");
>  		fwts_failed(fw, LOG_LEVEL_MEDIUM, "BadWakeAlarmS3",
>  			"Check if wakealarm works reliably for S3 tests.");
> 

Acked-by: Alex Hung <alex.hung@canonical.com>

Patch

diff --git a/src/acpi/s3/s3.c b/src/acpi/s3/s3.c
index bbb0497..6e1b4e4 100644
--- a/src/acpi/s3/s3.c
+++ b/src/acpi/s3/s3.c
@@ -47,10 +47,8 @@  static float s3_resume_time = 15.0;	/* Maximum allowed resume time */
 
 static int s3_init(fwts_framework *fw)
 {
-	int ret;
-
 	/* Pre-init - make sure wakealarm works so that we can wake up after suspend */
-	if ((ret = fwts_wakealarm_test_firing(fw, 1))) {
+	if (fwts_wakealarm_test_firing(fw, 1) != FWTS_OK) {
 		fwts_log_error(fw, "Cannot automatically wake machine up - aborting S3 test.");
 		fwts_failed(fw, LOG_LEVEL_MEDIUM, "BadWakeAlarmS3",
 			"Check if wakealarm works reliably for S3 tests.");