From: Jakub Kicinski Date: Mon, 3 Feb 2025 21:55:09 +0000 (-0800) Subject: tools: ynl-gen: don't output external constants X-Git-Tag: for-6.15/io_uring-rx-zc-20250325~17^2~6 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=7e8b24e24ac46038e48c9a042e7d9b31855cbca5;p=linux-block.git 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 Link: https://patch.msgid.link/20250203215510.1288728-1-kuba@kernel.org Signed-off-by: Paolo Abeni --- 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 = []