diff options
author | Jakub Kicinski <kuba@kernel.org> | 2025-02-03 13:55:09 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-05-29 11:03:00 +0200 |
commit | 91526279362d3708117194ad21372ffc8806ba3f (patch) | |
tree | b1d62d4c6bca2df1e08685ca77b98a5358d585b1 | |
parent | 37c07516ac6a527ef1e577eb69cbad6028f74ce5 (diff) |
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-x | tools/net/ynl/ynl-gen-c.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/net/ynl/ynl-gen-c.py b/tools/net/ynl/ynl-gen-c.py index 463f1394ab97..c78f1c1bca75 100755 --- a/tools/net/ynl/ynl-gen-c.py +++ b/tools/net/ynl/ynl-gen-c.py @@ -2417,6 +2417,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 = [] |