1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-11-02 19:36:22 +01:00

dm: core: Adjust dump-sorting to get stats only when needed

If we are not sorting the tree we don't need to get the stats. Adjust the
code to avoid the wasted time.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2023-09-19 20:05:48 -06:00
parent 65b9b3462b
commit a535a371a9

View File

@@ -90,9 +90,8 @@ static void dm_dump_tree_single(struct udevice *dev, bool sort)
int dev_count, uclasses;
struct udevice **devs = NULL;
dm_get_stats(&dev_count, &uclasses);
if (sort) {
dm_get_stats(&dev_count, &uclasses);
devs = calloc(dev_count, sizeof(struct udevice *));
if (!devs) {
printf("(out of memory)\n");