summaryrefslogtreecommitdiff
path: root/tools/net
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2023-01-26 03:02:35 +0300
committerJakub Kicinski <kuba@kernel.org>2023-01-27 03:32:41 +0300
commit3a43ded081f862aa2f66a8f4f6630a45a9081e58 (patch)
tree3e552d58609db416aa1114fac162540e25266a83 /tools/net
parentb49c34e217c629a9d282e84889dbe0128917b8c1 (diff)
downloadlinux-3a43ded081f862aa2f66a8f4f6630a45a9081e58.tar.xz
tools: ynl: store ops in ordered dict to avoid random ordering
When rendering code we should walk the ops in the order in which they are declared in the spec. This is both more intuitive and prevents code from jumping around when hashing in the dict changes. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/net')
-rwxr-xr-xtools/net/ynl/ynl-gen-c.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/net/ynl/ynl-gen-c.py b/tools/net/ynl/ynl-gen-c.py
index 9297cfacbe06..1aa872e582ab 100755
--- a/tools/net/ynl/ynl-gen-c.py
+++ b/tools/net/ynl/ynl-gen-c.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
import argparse
+import collections
import jsonschema
import os
import yaml
@@ -793,7 +794,7 @@ class Family:
# list of all operations
self.msg_list = []
# dict of operations which have their own message type (have attributes)
- self.ops = dict()
+ self.ops = collections.OrderedDict()
self.attr_sets = dict()
self.attr_sets_list = []