summaryrefslogtreecommitdiff
path: root/drivers/acpi/fan_core.c
diff options
context:
space:
mode:
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2022-02-11 08:09:29 -0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-02-25 20:49:29 +0100
commitd445571fa369cf08148dcd9bce563d5fae14fcd7 (patch)
tree7e2a5c28c83ea07941285b0eb275fdd91529a09a /drivers/acpi/fan_core.c
parent00ae053a0533155d830da27070a931e6fa747327 (diff)
downloadlinux-next-d445571fa369cf08148dcd9bce563d5fae14fcd7.tar.gz
ACPI: fan: Optimize struct acpi_fan_fif
We don't need u64 to store the information about _FIF. There are two booleans (fine_grain_ctrl and low_speed_notification) and one field step_size which can take value from 1-9. There are no internal users of revision field. So convert all fields to u8, by not directly extracting the _FIF info the struct. Use an intermediate buffer to extract and assign. This will help to do u32 math using these fields. No functional changes are expected. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/fan_core.c')
-rw-r--r--drivers/acpi/fan_core.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/acpi/fan_core.c b/drivers/acpi/fan_core.c
index 9f8e68403fad..484cee0fb13e 100644
--- a/drivers/acpi/fan_core.c
+++ b/drivers/acpi/fan_core.c
@@ -211,7 +211,8 @@ static int acpi_fan_get_fif(struct acpi_device *device)
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
struct acpi_fan *fan = acpi_driver_data(device);
struct acpi_buffer format = { sizeof("NNNN"), "NNNN" };
- struct acpi_buffer fif = { sizeof(fan->fif), &fan->fif };
+ u64 fields[4];
+ struct acpi_buffer fif = { sizeof(fields), fields };
union acpi_object *obj;
acpi_status status;
@@ -232,6 +233,11 @@ static int acpi_fan_get_fif(struct acpi_device *device)
status = -EINVAL;
}
+ fan->fif.revision = fields[0];
+ fan->fif.fine_grain_ctrl = fields[1];
+ fan->fif.step_size = fields[2];
+ fan->fif.low_speed_notification = fields[3];
+
err:
kfree(obj);
return status;