]> git.baikalelectronics.ru Git - kernel.git/commit
ACPI: glue: Rearrange find_child_checks()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 5 May 2022 18:52:57 +0000 (20:52 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 12 May 2022 14:52:32 +0000 (16:52 +0200)
commit9a39d1af367771e82885ca0ddfbad89a1ba4e7d8
tree7a7ffe02673d760dbaed79e8236a99c02e052a57
parent48b4b86538c8f7c4593ade46ab86104d8256d668
ACPI: glue: Rearrange find_child_checks()

Notice that it is not necessary to evaluate _STA in find_child_checks()
if the device is expected to have children, but there are none, so
move the children check to the front of the function.

Also notice that FIND_CHILD_MIN_SCORE can be returned right away if
_STA is missing, so make the function do so.

Finally, replace the ternary operator in the return statement argument
with an if () and a standalone return which is somewhat easier to
follow.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/glue.c