diff mbox

[RESEND] hpet: hpet_check: skip test3 if HPET address was not found (LP: #1257825)

Message ID 1386197869-3111-1-git-send-email-colin.king@canonical.com
State Accepted
Headers show

Commit Message

Colin Ian King Dec. 4, 2013, 10:57 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

It makes no sense to run hpet_check test3 if the hpet base address could
not be found. So skip this and inform the user why.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/hpet/hpet_check/hpet_check.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

Comments

Ivan Hu Dec. 9, 2013, 2:59 a.m. UTC | #1
On 12/05/2013 06:57 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> It makes no sense to run hpet_check test3 if the hpet base address could
> not be found. So skip this and inform the user why.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/hpet/hpet_check/hpet_check.c | 13 +++++++++----
>   1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/src/hpet/hpet_check/hpet_check.c b/src/hpet/hpet_check/hpet_check.c
> index 14afbd7..e7ba6af 100644
> --- a/src/hpet/hpet_check/hpet_check.c
> +++ b/src/hpet/hpet_check/hpet_check.c
> @@ -180,7 +180,7 @@ static int hpet_check_test1(fwts_framework *fw)
>   	}
>
>   	if (hpet_base_p == 0) {
> -		fwts_log_info(fw, "No base address found for HPET.");
> +		fwts_log_info(fw, "No base address found for HPET in the kernel log.");
>   		return FWTS_ERROR;
>   	}
>
> @@ -357,11 +357,16 @@ static int hpet_check_test3(fwts_framework *fw)
>   {
>   	int i;
>
> +	if (hpet_base_p == 0) {
> +		fwts_log_info(fw, "Test skipped because HPET address was not found.");
> +		return FWTS_SKIP;
> +	}
> +
>   	hpet_check_base_acpi_table(fw, "DSDT", 0);
>
> -	for (i=0;i<11;i++) {
> +	for (i = 0; i< 11; i++)
>   		hpet_check_base_acpi_table(fw, "SSDT", i);
> -	}
> +
>   	return FWTS_OK;
>   }
>
> @@ -373,7 +378,7 @@ static int hpet_check_test4(fwts_framework *fw)
>   	uint32_t clk_period;
>
>   	if (hpet_base_p == 0) {
> -		fwts_log_info(fw, "Test skipped because previous test failed.");
> +		fwts_log_info(fw, "Test skipped because HPET address was not found.");
>   		return FWTS_SKIP;
>   	}
>
>

Acked-by: Ivan Hu <ivan.hu@canonical.com>
Alex Hung Dec. 9, 2013, 3:49 a.m. UTC | #2
On 12/05/2013 06:57 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> It makes no sense to run hpet_check test3 if the hpet base address could
> not be found. So skip this and inform the user why.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/hpet/hpet_check/hpet_check.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/src/hpet/hpet_check/hpet_check.c b/src/hpet/hpet_check/hpet_check.c
> index 14afbd7..e7ba6af 100644
> --- a/src/hpet/hpet_check/hpet_check.c
> +++ b/src/hpet/hpet_check/hpet_check.c
> @@ -180,7 +180,7 @@ static int hpet_check_test1(fwts_framework *fw)
>  	}
>  
>  	if (hpet_base_p == 0) {
> -		fwts_log_info(fw, "No base address found for HPET.");
> +		fwts_log_info(fw, "No base address found for HPET in the kernel log.");
>  		return FWTS_ERROR;
>  	}
>  
> @@ -357,11 +357,16 @@ static int hpet_check_test3(fwts_framework *fw)
>  {
>  	int i;
>  
> +	if (hpet_base_p == 0) {
> +		fwts_log_info(fw, "Test skipped because HPET address was not found.");
> +		return FWTS_SKIP;
> +	}
> +
>  	hpet_check_base_acpi_table(fw, "DSDT", 0);
>  
> -	for (i=0;i<11;i++) {
> +	for (i = 0; i< 11; i++)
>  		hpet_check_base_acpi_table(fw, "SSDT", i);
> -	}
> +
>  	return FWTS_OK;
>  }
>  
> @@ -373,7 +378,7 @@ static int hpet_check_test4(fwts_framework *fw)
>  	uint32_t clk_period;
>  
>  	if (hpet_base_p == 0) {
> -		fwts_log_info(fw, "Test skipped because previous test failed.");
> +		fwts_log_info(fw, "Test skipped because HPET address was not found.");
>  		return FWTS_SKIP;
>  	}
>  
> 


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

Patch

diff --git a/src/hpet/hpet_check/hpet_check.c b/src/hpet/hpet_check/hpet_check.c
index 14afbd7..e7ba6af 100644
--- a/src/hpet/hpet_check/hpet_check.c
+++ b/src/hpet/hpet_check/hpet_check.c
@@ -180,7 +180,7 @@  static int hpet_check_test1(fwts_framework *fw)
 	}
 
 	if (hpet_base_p == 0) {
-		fwts_log_info(fw, "No base address found for HPET.");
+		fwts_log_info(fw, "No base address found for HPET in the kernel log.");
 		return FWTS_ERROR;
 	}
 
@@ -357,11 +357,16 @@  static int hpet_check_test3(fwts_framework *fw)
 {
 	int i;
 
+	if (hpet_base_p == 0) {
+		fwts_log_info(fw, "Test skipped because HPET address was not found.");
+		return FWTS_SKIP;
+	}
+
 	hpet_check_base_acpi_table(fw, "DSDT", 0);
 
-	for (i=0;i<11;i++) {
+	for (i = 0; i< 11; i++)
 		hpet_check_base_acpi_table(fw, "SSDT", i);
-	}
+
 	return FWTS_OK;
 }
 
@@ -373,7 +378,7 @@  static int hpet_check_test4(fwts_framework *fw)
 	uint32_t clk_period;
 
 	if (hpet_base_p == 0) {
-		fwts_log_info(fw, "Test skipped because previous test failed.");
+		fwts_log_info(fw, "Test skipped because HPET address was not found.");
 		return FWTS_SKIP;
 	}