acpi: wakealarm: remove failure messages for non-x86 arch

Message ID 20180808033556.16556-1-alex.hung@canonical.com
State Accepted
Headers show
Series
  • acpi: wakealarm: remove failure messages for non-x86 arch
Related show

Commit Message

Alex Hung Aug. 8, 2018, 3:35 a.m.
Many non-x86 do not have RTC wake alarm and generating a failure can be
confusing. The failure message is replaced by info instead.

Signed-off-by: Alex Hung <alex.hung@canonical.com>
---
 src/acpi/wakealarm/wakealarm.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Comments

ivanhu Aug. 14, 2018, 7:44 a.m. | #1
On 08/08/2018 11:35 AM, Alex Hung wrote:
> Many non-x86 do not have RTC wake alarm and generating a failure can be
> confusing. The failure message is replaced by info instead.
> 
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>   src/acpi/wakealarm/wakealarm.c | 11 ++++++-----
>   1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/src/acpi/wakealarm/wakealarm.c b/src/acpi/wakealarm/wakealarm.c
> index f47f08cb..0c5f1074 100644
> --- a/src/acpi/wakealarm/wakealarm.c
> +++ b/src/acpi/wakealarm/wakealarm.c
> @@ -37,21 +37,22 @@ static int wakealarm_test1(fwts_framework *fw)
>   	if (fwts_wakealarm_get(fw, &rtc_tm) == FWTS_OK) {
>   		fwts_passed(fw, "RTC with a RTC alarm ioctl() interface found.");
>   	} else {
> -		fwts_failed(fw, LOG_LEVEL_MEDIUM, "NoWakeAlarmTest1",
> -			"Could not find an RTC with an alarm ioctl() interface.");
>   #ifdef FWTS_ARCH_INTEL
>   		/* For x86 devices, this is considered a failure */
> +		fwts_failed(fw, LOG_LEVEL_MEDIUM, "NoWakeAlarmTest1",
> +			"Could not find an RTC with an alarm ioctl() interface.");
>   		fwts_advice(fw,
>   			"x86 devices generally should have an RTC wake alarm that "
>   			"is normally controlled by the RTC alarm ioctl() interface. This interface "
>   			"does not exist, so the wake alarm tests will be aborted.");
> +		return FWTS_ABORTED;
>   #else
> -		fwts_advice(fw,
> +		fwts_log_info(fw,
>   			"non-x86 devices sometimes do not have an RTC wake alarm that "
>   			"is normally controlled by the RTC alarm ioctl() interface. This "
> -			"interface does not exist, so the wake alarm tests will be aborted.");
> +			"interface does not exist, so the wake alarm tests will be skipped.");
> +		return FWTS_SKIP;
>   #endif
> -		return FWTS_ABORTED;
>   	}
>   	return FWTS_OK;
>   }
> 

Acked-by: Ivan Hu <ivan.hu@canonical.com>
Colin King Aug. 15, 2018, 7:52 a.m. | #2
On 08/08/18 04:35, Alex Hung wrote:
> Many non-x86 do not have RTC wake alarm and generating a failure can be
> confusing. The failure message is replaced by info instead.
> 
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/acpi/wakealarm/wakealarm.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/src/acpi/wakealarm/wakealarm.c b/src/acpi/wakealarm/wakealarm.c
> index f47f08cb..0c5f1074 100644
> --- a/src/acpi/wakealarm/wakealarm.c
> +++ b/src/acpi/wakealarm/wakealarm.c
> @@ -37,21 +37,22 @@ static int wakealarm_test1(fwts_framework *fw)
>  	if (fwts_wakealarm_get(fw, &rtc_tm) == FWTS_OK) {
>  		fwts_passed(fw, "RTC with a RTC alarm ioctl() interface found.");
>  	} else {
> -		fwts_failed(fw, LOG_LEVEL_MEDIUM, "NoWakeAlarmTest1",
> -			"Could not find an RTC with an alarm ioctl() interface.");
>  #ifdef FWTS_ARCH_INTEL
>  		/* For x86 devices, this is considered a failure */
> +		fwts_failed(fw, LOG_LEVEL_MEDIUM, "NoWakeAlarmTest1",
> +			"Could not find an RTC with an alarm ioctl() interface.");
>  		fwts_advice(fw,
>  			"x86 devices generally should have an RTC wake alarm that "
>  			"is normally controlled by the RTC alarm ioctl() interface. This interface "
>  			"does not exist, so the wake alarm tests will be aborted.");
> +		return FWTS_ABORTED;
>  #else
> -		fwts_advice(fw,
> +		fwts_log_info(fw,
>  			"non-x86 devices sometimes do not have an RTC wake alarm that "
>  			"is normally controlled by the RTC alarm ioctl() interface. This "
> -			"interface does not exist, so the wake alarm tests will be aborted.");
> +			"interface does not exist, so the wake alarm tests will be skipped.");
> +		return FWTS_SKIP;
>  #endif
> -		return FWTS_ABORTED;
>  	}
>  	return FWTS_OK;
>  }
> 
Acked-by: Colin Ian King <colin.king@canonical.com>

Patch

diff --git a/src/acpi/wakealarm/wakealarm.c b/src/acpi/wakealarm/wakealarm.c
index f47f08cb..0c5f1074 100644
--- a/src/acpi/wakealarm/wakealarm.c
+++ b/src/acpi/wakealarm/wakealarm.c
@@ -37,21 +37,22 @@  static int wakealarm_test1(fwts_framework *fw)
 	if (fwts_wakealarm_get(fw, &rtc_tm) == FWTS_OK) {
 		fwts_passed(fw, "RTC with a RTC alarm ioctl() interface found.");
 	} else {
-		fwts_failed(fw, LOG_LEVEL_MEDIUM, "NoWakeAlarmTest1",
-			"Could not find an RTC with an alarm ioctl() interface.");
 #ifdef FWTS_ARCH_INTEL
 		/* For x86 devices, this is considered a failure */
+		fwts_failed(fw, LOG_LEVEL_MEDIUM, "NoWakeAlarmTest1",
+			"Could not find an RTC with an alarm ioctl() interface.");
 		fwts_advice(fw,
 			"x86 devices generally should have an RTC wake alarm that "
 			"is normally controlled by the RTC alarm ioctl() interface. This interface "
 			"does not exist, so the wake alarm tests will be aborted.");
+		return FWTS_ABORTED;
 #else
-		fwts_advice(fw,
+		fwts_log_info(fw,
 			"non-x86 devices sometimes do not have an RTC wake alarm that "
 			"is normally controlled by the RTC alarm ioctl() interface. This "
-			"interface does not exist, so the wake alarm tests will be aborted.");
+			"interface does not exist, so the wake alarm tests will be skipped.");
+		return FWTS_SKIP;
 #endif
-		return FWTS_ABORTED;
 	}
 	return FWTS_OK;
 }