]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
tools: ynl-gen: don't add suffix for pure types
authorJakub Kicinski <kuba@kernel.org>
Wed, 23 Jul 2025 17:10:42 +0000 (10:10 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 25 Jul 2025 00:28:49 +0000 (17:28 -0700)
Don't add _req to helper names for pure types. We don't currently
print those so it makes no difference to existing codegen.

Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/20250723171046.4027470-2-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/net/ynl/pyynl/ynl_gen_c.py

index 76032e01c2e75957856f50d3b5caea32c2a80c82..1bdcc368e7763e053cc5e7b1ee36aea1d6510316 100755 (executable)
@@ -1879,7 +1879,9 @@ def rdir(direction):
 def op_prefix(ri, direction, deref=False):
     suffix = f"_{ri.type_name}"
 
-    if not ri.op_mode or ri.op_mode == 'do':
+    if not ri.op_mode:
+        pass
+    elif ri.op_mode == 'do':
         suffix += f"{direction_to_suffix[direction]}"
     else:
         if direction == 'request':