aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Wolf <[email protected]>2023-12-18 20:24:15 +0100
committerHans de Goede <[email protected]>2023-12-19 16:32:46 +0100
commit41dd6822949ec6e83416a0e245f32a726110056a (patch)
treee52636fec3da4e0b3631cdaa646b8b8ebb5075bd
parenta92d3078244891c1bc4dc2112ae58b416875d296 (diff)
platform/x86: wmi: Remove unused variable in address space handler
The variable "i" is always zero and only used in shift operations. Remove it to make the code more readable. Reviewed-by: Ilpo Järvinen <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Armin Wolf <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
-rw-r--r--drivers/platform/x86/wmi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index 7303702290e5..906d3a2831ae 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -1144,7 +1144,7 @@ acpi_wmi_ec_space_handler(u32 function, acpi_physical_address address,
u32 bits, u64 *value,
void *handler_context, void *region_context)
{
- int result = 0, i = 0;
+ int result = 0;
u8 temp = 0;
if ((address > 0xFF) || !value)
@@ -1158,9 +1158,9 @@ acpi_wmi_ec_space_handler(u32 function, acpi_physical_address address,
if (function == ACPI_READ) {
result = ec_read(address, &temp);
- (*value) |= ((u64)temp) << i;
+ *value = temp;
} else {
- temp = 0xff & ((*value) >> i);
+ temp = 0xff & *value;
result = ec_write(address, temp);
}