aboutsummaryrefslogtreecommitdiffstats
path: root/tools/net/ynl/pyynl/ynl_gen_c.py
diff options
context:
space:
mode:
authorJakub Kicinski <[email protected]>2025-04-14 21:18:45 +0000
committerJakub Kicinski <[email protected]>2025-04-17 01:09:41 +0000
commitdfa464b4a603984d648a9beb9bce72df5858c1e2 (patch)
tree3c2bbca0156142d69119bc78acb25fe4c45f35e9 /tools/net/ynl/pyynl/ynl_gen_c.py
parenttools: ynl-gen: don't declare loop iterator in place (diff)
downloadkernel-dfa464b4a603984d648a9beb9bce72df5858c1e2.tar.gz
kernel-dfa464b4a603984d648a9beb9bce72df5858c1e2.zip
tools: ynl-gen: move local vars after the opening bracket
The "function writing helper" tries to put local variables between prototype and the opening bracket. Clearly wrong, but up until now nothing actually uses it to write local vars so it wasn't noticed. Reviewed-by: Donald Hunter <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'tools/net/ynl/pyynl/ynl_gen_c.py')
-rwxr-xr-xtools/net/ynl/pyynl/ynl_gen_c.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/net/ynl/pyynl/ynl_gen_c.py b/tools/net/ynl/pyynl/ynl_gen_c.py
index 305f5696bc4f..662a925bd9e1 100755
--- a/tools/net/ynl/pyynl/ynl_gen_c.py
+++ b/tools/net/ynl/pyynl/ynl_gen_c.py
@@ -1399,9 +1399,9 @@ class CodeWriter:
def write_func(self, qual_ret, name, body, args=None, local_vars=None):
self.write_func_prot(qual_ret=qual_ret, name=name, args=args)
+ self.block_start()
self.write_func_lvar(local_vars=local_vars)
- self.block_start()
for line in body:
self.p(line)
self.block_end()