tools: ynl-gen: get attr type outside of if()
authorJakub Kicinski <kuba@kernel.org>
Thu, 8 Jun 2023 21:11:53 +0000 (14:11 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 9 Jun 2023 21:40:31 +0000 (14:40 -0700)
commite4ea3cc68472b1cc0b68a1adf145ee39fb90a506
tree71413c6e7b6bf461655ee500ef5d56487a5361a9
parent2c0f1466867c8405224b97d978b67f35d76b1dc1
tools: ynl-gen: get attr type outside of if()

Reading attr type with mnl_attr_get_type() for each condition
leads to most conditions being longer than 80 chars.
Avoid this by reading the type to a variable on the stack.

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