ACPI: utils: Rearrange in acpi_evaluate_reference()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 8 Dec 2023 20:05:19 +0000 (21:05 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 15 Dec 2023 09:46:04 +0000 (10:46 +0100)
commit87824da27b0aee399600d313667c1d812c2749d8
treeb4e7a14ea89d875c773bc3ccdfb362e05f45452e
parent3814876467e7557ccb1eecc28cf7f68d029f445e
ACPI: utils: Rearrange in acpi_evaluate_reference()

The code in acpi_evaluate_reference() can be improved in some ways
without changing its observable behavior.  Among other things:

 * None of the local variables in that function except for buffer
   needs to be initialized.

 * The element local variable is only used in the for () loop block,
   so it can be defined there.

 * Multiple checks can be combined.

 * Code duplication related to error handling can be eliminated.

 * Redundant inner parens can be dropped.

Modify the function as per the above.

No intentional functional impact.

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