<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"><alex.hung@canonical.com></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) &&
((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);
}
</pre>
</blockquote>
Acked-by: Ivan Hu <a class="moz-txt-link-rfc2396E"
href="mailto:ivan.hu@canonical.com"><ivan.hu@canonical.com></a>
</body>
</html>