Skip to content

Commit 7e8b24e

Browse files
kuba-mooPaolo Abeni
authored andcommitted
tools: ynl-gen: don't output external constants
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]>
1 parent 5f9e5d2 commit 7e8b24e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/net/ynl/pyynl/ynl_gen_c.py

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

25502550
defines = []
25512551
for const in family['definitions']:
2552+
if const.get('header'):
2553+
continue
2554+
25522555
if const['type'] != 'const':
25532556
cw.writes_defines(defines)
25542557
defines = []

0 commit comments

Comments
 (0)