ACPI: PM: Use max() for clearer D3 state selection in acpi_dev_pm_get_state
PATCH v3 1/1 ACPI: PM: Use max() for clearer D3 state selection in acpi_dev_pm_get_state
Signed-off-by Prabhakar Pujeri <[email protected]>
--- drivers/acpi/device_pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/device_pm.c +1 -1
@@ -760,7 +760,7 @@ static int acpi_dev_pm_get_state(struct device *dev, struct acpi_device *adev,if (!adev->power.states[ret].flags.valid) ret =ACPI_STATE_D3_COLD ; - d_max = ret > d_min ? ret : d_min; + d_max =max_t (ret, d_min); }else {return -ENODATA ; }
Signature · 1 line
2.45.2
Rafael J. Wysocki
maintainerQuoted 11 lines · Prabhakar Pujeri
Signed-off-by Prabhakar Pujeri <[email protected]>--- drivers/acpi/device_pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/acpi/device_pm.c +0
-0
drivers/acpi/device_pm.c static int acpi_dev_pm_get_state(struct device *dev, struct acpi_device *adev, · line 763
Quoted 5 lines
drivers/acpi/device_pm.c +1
-1@@ -760,7 +760,7 @@ static int acpi_dev_pm_get_state(struct device *dev, struct acpi_device *adev,if (!adev->power.states[ret].flags.valid) ret =ACPI_STATE_D3_COLD ; - d_max = ret > d_min ? ret : d_min; + d_max =max_t (ret, d_min);
Does this compile?
Quoted 7 lines
drivers/acpi/device_pm.c +0
-1}else {return -ENODATA ; } --2.45.2