ACK: [PATCH 01/13] lib: fwts_cpu: make found a boolean

ivanhu ivan.hu at canonical.com
Thu Aug 16 09:02:08 UTC 2018



On 08/14/2018 07:24 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Variable found should be a boolean rather than an int
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>  src/lib/src/fwts_cpu.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/lib/src/fwts_cpu.c b/src/lib/src/fwts_cpu.c
> index 6806418c..e79f5b0a 100644
> --- a/src/lib/src/fwts_cpu.c
> +++ b/src/lib/src/fwts_cpu.c
> @@ -107,7 +107,8 @@ fwts_cpuinfo_x86 *fwts_cpu_get_info(int which_cpu)
>  	FILE *fp;
>  	char buffer[1024];
>  	fwts_cpuinfo_x86 *cpu;
> -	int cpu_num = -1, found = 0;
> +	int cpu_num = -1;
> +	bool found = false;
>  
>  	if ((cpu = (fwts_cpuinfo_x86*)calloc(1, sizeof(fwts_cpuinfo_x86))) == NULL)
>  		return NULL;
> @@ -138,7 +139,7 @@ fwts_cpuinfo_x86 *fwts_cpu_get_info(int which_cpu)
>  				continue;
>  		}
>  
> -		found = 1;
> +		found = true;
>  
>  		if (!strncmp(buffer, "vendor_id", 9)) {
>  			cpu->vendor_id = strdup(ptr);

Acked-by: Ivan Hu <ivan.hu at canonical.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/fwts-devel/attachments/20180816/600628d6/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/fwts-devel/attachments/20180816/600628d6/attachment.sig>


More information about the fwts-devel mailing list