Skip to content

Commit

Permalink
tools: ynl-gen: don't output external constants
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jakub Kicinski authored and Paolo Abeni committed Feb 6, 2025
1 parent 5f9e5d2 commit 7e8b24e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/net/ynl/pyynl/ynl_gen_c.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down

0 comments on commit 7e8b24e

Please sign in to comment.