summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/export-to-postgresql.py
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-01-14 19:46:47 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-01-25 18:59:43 +0100
commitc1013ff7a5472db637c56bb6237f8343398c03a7 (patch)
tree51c3ce7d1f1c0bc0e0586d19729373949ea58694 /tools/perf/scripts/python/export-to-postgresql.py
parent6ee1d745b7c9fd573fba142a2efdad76a9f1cb04 (diff)
ACPI: scan: Rearrange memory allocation in acpi_device_add()
The upfront allocation of new_bus_id is done to avoid allocating memory under acpi_device_lock, but it doesn't really help, because (1) it leads to many unnecessary memory allocations for _ADR devices, (2) kstrdup_const() is run under that lock anyway and (3) it complicates the code. Rearrange acpi_device_add() to allocate memory for a new struct acpi_device_bus_id instance only when necessary, eliminate a redundant local variable from it and reduce the number of labels in there. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions