tools: ynl-gen: resolve enum vs struct name conflicts
authorJakub Kicinski <kuba@kernel.org>
Fri, 9 Jun 2023 21:43:40 +0000 (14:43 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 12 Jun 2023 10:01:03 +0000 (11:01 +0100)
commit2c9d47a095f7d0380e35064121bc8838dbf136cb
treed195d036d32e1f84ae1c448b938fb6117b0b3ca5
parentdddc9f53da3e1e359e56edc8da301e145e3b97df
tools: ynl-gen: resolve enum vs struct name conflicts

Ethtool has an attribute set called stringset, from which
we'll generate struct ethtool_stringset. Unfortunately,
the old ethtool header declares enum ethtool_stringset
(the same name), to which compilers object.

This seems unavoidable. Check struct names against known
constants and append an underscore if conflict is detected.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/net/ynl/ynl-gen-c.py