ACK: [PATCH] acpiinfo: update acpi version supported by kernel

ivanhu ivan.hu at canonical.com
Thu Aug 16 09:22:28 UTC 2018



On 08/16/2018 06:55 AM, Alex Hung wrote:
> ACPI version is formated as major.minor, and therefore float is used to
> replace int.
>
> In addition, two indents are also fixed.
>
> Signed-off-by: Alex Hung <alex.hung at canonical.com>
> ---
>  src/acpi/acpiinfo/acpiinfo.c | 24 ++++++++++++++----------
>  1 file changed, 14 insertions(+), 10 deletions(-)
>
> diff --git a/src/acpi/acpiinfo/acpiinfo.c b/src/acpi/acpiinfo/acpiinfo.c
> index d3aa6b2a..b96f7b1c 100644
> --- a/src/acpi/acpiinfo/acpiinfo.c
> +++ b/src/acpi/acpiinfo/acpiinfo.c
> @@ -68,30 +68,34 @@ static int acpiinfo_test1(fwts_framework *fw)
>  
>  	if (((str = fwts_get("/sys/module/acpi/parameters/acpica_version")) == NULL) &&
>  	    ((str = fwts_get("/proc/acpi/info")) == NULL))
> -                fwts_log_info(fw,
> +			fwts_log_info(fw,
>  			"Cannot get ACPI version info from "
>  			"/sys/module/acpi/parameters/acpica_version or /proc/acpi/info");
> -        else {
> -		int version;
> +	else {
> +		float version;
>  		int yearmonth;
>  
>  		fwts_chop_newline(str);
>  
>  		sscanf(str, "%6d", &yearmonth);
>  
> -		if (yearmonth > 201505) {
> -			version = 6;
> +		if (yearmonth > 201609) {
> +			version = 6.2;
> +		} else if (yearmonth > 201509) {
> +			version = 6.1;
> +		} else if (yearmonth > 201404) {
> +			version = 6.0;
>  		} else if (yearmonth > 201110) {
> -			version = 5;
> +			version = 5.0;
>  		} else if (yearmonth > 200906) {
> -			version = 4;
> +			version = 4.0;
>  		} else if (yearmonth > 200505) {
> -			version = 3;
> +			version = 3.0;
>  		} else {
> -			version = 2;
> +			version = 2.0;
>  		}
>  
> -		fwts_log_info(fw, "Kernel ACPICA driver version: %s, supports ACPI %d.0", str, version);
> +		fwts_log_info(fw, "Kernel ACPICA driver version: %s, supports ACPI %2.1f", str, version);
>  		free(str);
>  	}
>  
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/d337e8d8/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/d337e8d8/attachment.sig>


More information about the fwts-devel mailing list