aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Pirko <[email protected]>2023-10-21 13:27:04 +0200
committerJakub Kicinski <[email protected]>2023-10-23 16:12:46 -0700
commit2260d39cd01aff3b5791db25810e40fe03ae71bf (patch)
tree7017c9681e4618817b4ade2cd7ee5bec8b7e89a2
parent4e2846fd6684227c8f8129ec184fbf090279216d (diff)
tools: ynl-gen: render rsp_parse() helpers if cmd has only dump op
Due to the check in RenderInfo class constructor, type_consistent flag is set to False to avoid rendering the same response parsing helper for do and dump ops. However, in case there is no do, the helper needs to be rendered for dump op. So split check to achieve that. Signed-off-by: Jiri Pirko <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
-rwxr-xr-xtools/net/ynl/ynl-gen-c.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/net/ynl/ynl-gen-c.py b/tools/net/ynl/ynl-gen-c.py
index 7d6c318397be..ed35a307c960 100755
--- a/tools/net/ynl/ynl-gen-c.py
+++ b/tools/net/ynl/ynl-gen-c.py
@@ -1112,10 +1112,13 @@ class RenderInfo:
# 'do' and 'dump' response parsing is identical
self.type_consistent = True
- if op_mode != 'do' and 'dump' in op and 'do' in op:
- if ('reply' in op['do']) != ('reply' in op["dump"]):
- self.type_consistent = False
- elif 'reply' in op['do'] and op["do"]["reply"] != op["dump"]["reply"]:
+ if op_mode != 'do' and 'dump' in op:
+ if 'do' in op:
+ if ('reply' in op['do']) != ('reply' in op["dump"]):
+ self.type_consistent = False
+ elif 'reply' in op['do'] and op["do"]["reply"] != op["dump"]["reply"]:
+ self.type_consistent = False
+ else:
self.type_consistent = False
self.attr_set = attr_set