diff mbox

bios: mtrr: make skiperror a boolean

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

Commit Message

Colin Ian King Dec. 7, 2012, 12:22 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Make skiperror a bool type.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/bios/mtrr/mtrr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Alex Hung Dec. 13, 2012, 2:23 a.m. UTC | #1
On 12/07/2012 08:22 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Make skiperror a bool type.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/bios/mtrr/mtrr.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/bios/mtrr/mtrr.c b/src/bios/mtrr/mtrr.c
> index eb8fbbf..6dbc8e2 100644
> --- a/src/bios/mtrr/mtrr.c
> +++ b/src/bios/mtrr/mtrr.c
> @@ -263,7 +263,7 @@ static int validate_iomem(fwts_framework *fw)
>   		int type, type_must, type_mustnot;
>   		char *c, *c2;
>   		int i;
> -		int skiperror = 0;
> +		bool skiperror = false;
>
>   		if (fgets(buffer, 4095, file)==NULL)
>   			break;
> @@ -321,14 +321,14 @@ static int validate_iomem(fwts_framework *fw)
>   				c2, cache_to_string(type & type_mustnot));
>   			fwts_tag_failed(fw, FWTS_TAG_BIOS);
>   			if (type_must == UNCACHED)
> -				skiperror = 1;
> +				skiperror = true;
>   		}
>
>   		if (type & DEFAULT) {
>   			type |= UNCACHED;
>   			type &= ~DEFAULT;
>   		}
> -		if ((type & type_must)!=type_must && skiperror==0) {
> +		if (((type & type_must) != type_must) && !skiperror) {
>   			failed++;
>   			fwts_failed(fw, LOG_LEVEL_MEDIUM,
>   				"MTRRLackingAttr",
>

Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan Hu Dec. 13, 2012, 9:44 a.m. UTC | #2
On 12/07/2012 08:22 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Make skiperror a bool type.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/bios/mtrr/mtrr.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/bios/mtrr/mtrr.c b/src/bios/mtrr/mtrr.c
> index eb8fbbf..6dbc8e2 100644
> --- a/src/bios/mtrr/mtrr.c
> +++ b/src/bios/mtrr/mtrr.c
> @@ -263,7 +263,7 @@ static int validate_iomem(fwts_framework *fw)
>   		int type, type_must, type_mustnot;
>   		char *c, *c2;
>   		int i;
> -		int skiperror = 0;
> +		bool skiperror = false;
>
>   		if (fgets(buffer, 4095, file)==NULL)
>   			break;
> @@ -321,14 +321,14 @@ static int validate_iomem(fwts_framework *fw)
>   				c2, cache_to_string(type & type_mustnot));
>   			fwts_tag_failed(fw, FWTS_TAG_BIOS);
>   			if (type_must == UNCACHED)
> -				skiperror = 1;
> +				skiperror = true;
>   		}
>
>   		if (type & DEFAULT) {
>   			type |= UNCACHED;
>   			type &= ~DEFAULT;
>   		}
> -		if ((type & type_must)!=type_must && skiperror==0) {
> +		if (((type & type_must) != type_must) && !skiperror) {
>   			failed++;
>   			fwts_failed(fw, LOG_LEVEL_MEDIUM,
>   				"MTRRLackingAttr",
>
Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox

Patch

diff --git a/src/bios/mtrr/mtrr.c b/src/bios/mtrr/mtrr.c
index eb8fbbf..6dbc8e2 100644
--- a/src/bios/mtrr/mtrr.c
+++ b/src/bios/mtrr/mtrr.c
@@ -263,7 +263,7 @@  static int validate_iomem(fwts_framework *fw)
 		int type, type_must, type_mustnot;
 		char *c, *c2;
 		int i;
-		int skiperror = 0;
+		bool skiperror = false;
 
 		if (fgets(buffer, 4095, file)==NULL)
 			break;
@@ -321,14 +321,14 @@  static int validate_iomem(fwts_framework *fw)
 				c2, cache_to_string(type & type_mustnot));
 			fwts_tag_failed(fw, FWTS_TAG_BIOS);
 			if (type_must == UNCACHED)
-				skiperror = 1;
+				skiperror = true;
 		}
 
 		if (type & DEFAULT) {
 			type |= UNCACHED;
 			type &= ~DEFAULT;
 		}
-		if ((type & type_must)!=type_must && skiperror==0) {
+		if (((type & type_must) != type_must) && !skiperror) {
 			failed++;
 			fwts_failed(fw, LOG_LEVEL_MEDIUM,
 				"MTRRLackingAttr",