projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
56bf02c
)
tools: ynl: use display hints for formatting of scalar attrs
author
Jakub Kicinski
<kuba@kernel.org>
Wed, 26 Jun 2024 20:12:34 +0000
(13:12 -0700)
committer
Jakub Kicinski
<kuba@kernel.org>
Thu, 27 Jun 2024 21:22:42 +0000
(14:22 -0700)
Use display hints for formatting scalar attrs. This is specifically
useful for formatting IPv4 addresses carried typically as u32.
Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
Link:
https://patch.msgid.link/20240626201234.2572964-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/net/ynl/lib/ynl.py
patch
|
blob
|
history
diff --git
a/tools/net/ynl/lib/ynl.py
b/tools/net/ynl/lib/ynl.py
index
35e6669
..
d42c1d6
100644
(file)
--- a/
tools/net/ynl/lib/ynl.py
+++ b/
tools/net/ynl/lib/ynl.py
@@
-743,6
+743,8
@@
class YnlFamily(SpecFamily):
decoded = attr.as_scalar(attr_spec['type'], attr_spec.byte_order)
if 'enum' in attr_spec:
decoded = self._decode_enum(decoded, attr_spec)
+ elif attr_spec.display_hint:
+ decoded = self._formatted_string(decoded, attr_spec.display_hint)
elif attr_spec["type"] == 'indexed-array':
decoded = self._decode_array_attr(attr, attr_spec)
elif attr_spec["type"] == 'bitfield32':