[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fwts-devel
Subject:    ACK: [PATCH] acpiinfo: update acpi version supported by kernel
From:       ivanhu <ivan.hu () canonical ! com>
Date:       2018-08-16 9:22:28
Message-ID: 8b4b55a9-aeb7-18ad-7de8-4d4988cdf9c9 () canonical ! com
[Download RAW message or body]

[Attachment #2 (multipart/signed)]

[Attachment #4 (multipart/mixed)]

[Attachment #6 (multipart/alternative)]


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@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@canonical.com>

[Attachment #9 (text/html)]

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 08/16/2018 06:55 AM, Alex Hung
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:20180815225554.20128-1-alex.hung@canonical.com">
      <pre wrap="">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 <a class="moz-txt-link-rfc2396E" \
                href="mailto:alex.hung@canonical.com">&lt;alex.hung@canonical.com&gt;</a>
                
---
 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) \
&amp;&amp;  ((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", &amp;yearmonth);
 
-		if (yearmonth &gt; 201505) {
-			version = 6;
+		if (yearmonth &gt; 201609) {
+			version = 6.2;
+		} else if (yearmonth &gt; 201509) {
+			version = 6.1;
+		} else if (yearmonth &gt; 201404) {
+			version = 6.0;
 		} else if (yearmonth &gt; 201110) {
-			version = 5;
+			version = 5.0;
 		} else if (yearmonth &gt; 200906) {
-			version = 4;
+			version = 4.0;
 		} else if (yearmonth &gt; 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);
 	}
 
</pre>
    </blockquote>
    Acked-by: Ivan Hu <a class="moz-txt-link-rfc2396E"
      href="mailto:ivan.hu@canonical.com">&lt;ivan.hu@canonical.com&gt;</a>
  </body>
</html>


["signature.asc" (application/pgp-signature)]
[Attachment #11 (text/plain)]

-- 
fwts-devel mailing list
fwts-devel@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/fwts-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic