Skip to content

Commit 6204656

Browse files
committed
tools: ynl-gen: allow uapi headers in sub-dirs
Binder places its headers under include/uapi/linux/android/ Make sure replace / with _ in the uAPI header guard, the c_upper() is more strict and only converts - to _. This is likely a good constraint to have, to enforce sane naming in enums etc. But paths may include /. Signed-off-by: Li Li <dualli@google.com> Link: https://patch.msgid.link/20241113193239.2113577-2-dualli@chromium.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 5bf99ba commit 6204656

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2419,6 +2419,7 @@ def uapi_enum_start(family, cw, obj, ckey='', enum_name='enum-name'):
24192419

24202420
def render_uapi(family, cw):
24212421
hdr_prot = f"_UAPI_LINUX_{c_upper(family.uapi_header_name)}_H"
2422+
hdr_prot = hdr_prot.replace('/', '_')
24222423
cw.p('#ifndef ' + hdr_prot)
24232424
cw.p('#define ' + hdr_prot)
24242425
cw.nl()

0 commit comments

Comments
 (0)