From b2f23afe668ff7f83d2c31ba0115d47a4cb12565 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Thu, 20 Aug 2020 04:03:13 -0400 Subject: [PATCH] amd/registers: sort registers by offset in json Acked-by: Samuel Pitoiset Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/amd/registers/regdb.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/amd/registers/regdb.py b/src/amd/registers/regdb.py index fc9a0a2788e..0167365d7c8 100644 --- a/src/amd/registers/regdb.py +++ b/src/amd/registers/regdb.py @@ -213,7 +213,7 @@ class RegisterDatabase(object): Perform some basic canonicalization: - enum entries are sorted by value - register type fields are sorted by starting bit - - __register_mappings is sorted by name + - __register_mappings is sorted by offset - the chips field of register mappings is sorted Lazily computes the set of all chips mentioned by register mappings. @@ -230,10 +230,10 @@ class RegisterDatabase(object): self.__regmap_by_addr = defaultdict(list) self.__chips = set() - # Merge regiseter mappings using sort order and garbage collect enums + # Merge register mappings using sort order and garbage collect enums # and register types. old_register_mappings = self.__register_mappings - old_register_mappings.sort(key=lambda regmap: regmap.name) + old_register_mappings.sort(key=lambda regmap: regmap.map.at) self.__register_mappings = [] for regmap in old_register_mappings: -- 2.30.2