netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Donald Hunter <donald.hunter@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: davem@davemloft.net,  netdev@vger.kernel.org,
	 edumazet@google.com, pabeni@redhat.com,  jiri@resnulli.us
Subject: Re: [PATCH net-next] tools: ynl: use display hints for formatting of scalar attrs
Date: Thu, 27 Jun 2024 10:22:20 +0100	[thread overview]
Message-ID: <m2jziad9kj.fsf@gmail.com> (raw)
In-Reply-To: <20240626201234.2572964-1-kuba@kernel.org> (Jakub Kicinski's message of "Wed, 26 Jun 2024 13:12:34 -0700")

Jakub Kicinski <kuba@kernel.org> writes:

> Use display hints for formatting scalar attrs. This is specifically
> useful for formatting IPv4 addresses carried typically as u32.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>

I don't know how scalars got missed out :shrug:

Reviewed-by: Donald Hunter <donald.hunter@gmail.com>

Thanks!

> ---
> CC: donald.hunter@gmail.com
> CC: jiri@resnulli.us
> ---
>  tools/net/ynl/lib/ynl.py | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/lib/ynl.py
> index 35e666928119..d42c1d605969 100644
> --- a/tools/net/ynl/lib/ynl.py
> +++ b/tools/net/ynl/lib/ynl.py
> @@ -743,6 +743,8 @@ genl_family_name_to_id = None
>                  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':

  reply	other threads:[~2024-06-27  9:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-26 20:12 [PATCH net-next] tools: ynl: use display hints for formatting of scalar attrs Jakub Kicinski
2024-06-27  9:22 ` Donald Hunter [this message]
2024-06-27 21:30 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2jziad9kj.fsf@gmail.com \
    --to=donald.hunter@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).