Skip to content

Commit 9152627

Browse files
kuba-moogregkh
authored andcommitted
tools: ynl-gen: don't output external constants
[ Upstream commit 7e8b24e ] 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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 37c0751 commit 9152627

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/net/ynl/ynl-gen-c.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2417,6 +2417,9 @@ def render_uapi(family, cw):
24172417

24182418
defines = []
24192419
for const in family['definitions']:
2420+
if const.get('header'):
2421+
continue
2422+
24202423
if const['type'] != 'const':
24212424
cw.writes_defines(defines)
24222425
defines = []

0 commit comments

Comments
 (0)