Skip to content

Commit d7e0481

Browse files
committed
ACPI: EC: Fix up fast path check in acpi_ec_add()
The fast path check in acpi_ec_add() is not incorrect, because in fact acpi_device_hid(device) can be equal to ACPI_ECDT_HID only if boot_ec is not NULL, but it may confuse static checkers, so change it to explicitly check boot_ec upfront and use the slow path if that pointer is NULL. Link: https://lore.kernel.org/linux-acpi/20200406144217.GA68494@mwanda/ Fixes: 3d9b8dd ("ACPI: EC: Use fast path in acpi_ec_add() for DSDT boot EC") Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 2ce94bc commit d7e0481

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/acpi/ec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,8 +1589,8 @@ static int acpi_ec_add(struct acpi_device *device)
15891589
strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME);
15901590
strcpy(acpi_device_class(device), ACPI_EC_CLASS);
15911591

1592-
if ((boot_ec && boot_ec->handle == device->handle) ||
1593-
!strcmp(acpi_device_hid(device), ACPI_ECDT_HID)) {
1592+
if (boot_ec && (boot_ec->handle == device->handle ||
1593+
!strcmp(acpi_device_hid(device), ACPI_ECDT_HID))) {
15941594
/* Fast path: this device corresponds to the boot EC. */
15951595
ec = boot_ec;
15961596
} else {

0 commit comments

Comments
 (0)