[PATCH] bios: mtrr: make the failed flag a boolean

IvanHu ivan.hu at canonical.com
Thu Dec 13 09:44:01 UTC 2012


On 12/07/2012 08:16 AM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Make the failed flag a boolean.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>   src/bios/mtrr/mtrr.c | 9 +++++----
>   1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/src/bios/mtrr/mtrr.c b/src/bios/mtrr/mtrr.c
> index e2ee506..8bb4b0f 100644
> --- a/src/bios/mtrr/mtrr.c
> +++ b/src/bios/mtrr/mtrr.c
> @@ -26,6 +26,7 @@
>   #include <stdlib.h>
>   #include <stdio.h>
>   #include <string.h>
> +#include <stdbool.h>
>   #include <sys/types.h>
>   #include <sys/stat.h>
>   #include <sys/ioctl.h>
> @@ -420,22 +421,22 @@ static int mtrr_test1(fwts_framework *fw)
>   static int mtrr_test2(fwts_framework *fw)
>   {
>   	if (klog != NULL) {
> -		int failed = 0;
> +		bool failed = false;
>
>   		if (fwts_klog_regex_find(fw, klog, "mtrr: your CPUs had inconsistent fixed MTRR settings") > 0) {
>   			fwts_log_info(fw, "Detected CPUs with inconsistent fixed MTRR settings which the kernel fixed.");
>   			fwts_tag_failed(fw, FWTS_TAG_BIOS);
> -			failed = 1;
> +			failed = true;
>   		}
>   		if (fwts_klog_regex_find(fw, klog, "mtrr: your CPUs had inconsistent variable MTRR settings") > 0) {
>   			fwts_log_info(fw, "Detected CPUs with inconsistent variable MTRR settings which the kernel fixed.");
>   			fwts_tag_failed(fw, FWTS_TAG_BIOS);
> -			failed = 1;
> +			failed = true;
>   		}
>   		if (fwts_klog_regex_find(fw, klog, "mtrr: your CPUs had inconsistent MTRRdefType") > 0) {
>   			fwts_log_info(fw, "Detected CPUs with inconsistent variable MTRR settings which the kernel fixed.");
>   			fwts_tag_failed(fw, FWTS_TAG_BIOS);
> -			failed = 1;
> +			failed = true;
>   		}
>
>   		if (failed)
>
Acked-by: Ivan Hu <ivan.hu at canonical.com>



More information about the fwts-devel mailing list