summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2025-02-04 00:55:09 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-05-29 12:13:37 +0300
commitc3ce9e045b43edf58ca0efea23f860c4549b5bb5 (patch)
tree99811ab21bbaed6be260a6848c2d9cb76e88375e
parent9db7bc4161285b10e580c0df808fcc6607d6d94f (diff)
downloadlinux-c3ce9e045b43edf58ca0efea23f860c4549b5bb5.tar.xz
tools: ynl-gen: don't output external constants
[ Upstream commit 7e8b24e24ac46038e48c9a042e7d9b31855cbca5 ] A definition with a "header" property is an "external" definition for C code, as in it is defined already in another C header file. Other languages will need the exact value but C codegen should not recreate it. So don't output those definitions in the uAPI header. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Link: https://patch.msgid.link/20250203215510.1288728-1-kuba@kernel.org Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rwxr-xr-xtools/net/ynl/pyynl/ynl_gen_c.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/net/ynl/pyynl/ynl_gen_c.py b/tools/net/ynl/pyynl/ynl_gen_c.py
index c2eabc90dce8..aa08b8b1463d 100755
--- a/tools/net/ynl/pyynl/ynl_gen_c.py
+++ b/tools/net/ynl/pyynl/ynl_gen_c.py
@@ -2549,6 +2549,9 @@ def render_uapi(family, cw):
defines = []
for const in family['definitions']:
+ if const.get('header'):
+ continue
+
if const['type'] != 'const':
cw.writes_defines(defines)
defines = []