netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>,
	Donald Hunter <donald.hunter@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, pabeni@redhat.com,
	edumazet@google.com
Subject: Re: [PATCH net-next 2/2 v2] tools: ynl-gen: fix parse multi-attr enum attribute
Date: Thu, 13 Jul 2023 09:08:36 -0700	[thread overview]
Message-ID: <20230713090836.13c946bb@kernel.org> (raw)
In-Reply-To: <20230713090550.132858-3-arkadiusz.kubalewski@intel.com>

On Thu, 13 Jul 2023 11:05:50 +0200 Arkadiusz Kubalewski wrote:
> @@ -436,7 +435,7 @@ class YnlFamily(SpecFamily):
>              decoded = attr.as_struct(members)
>              for m in members:
>                  if m.enum:
> -                    self._decode_enum(decoded, m)
> +                    decoded[m] = self._decode_enum(decoded[m], m)

Yeah, not sure this is right.

Adding Donald, dropping Chuck and LMKL (please use this CC list for v3).

Given the code before the change we can assume that m is a complex type
describing the member so decoded[m] is likely going to explode.

I think you should move the enum decoding into as_struct(), transforming
the code into similar fashion as you did for responses (changing the
@decoded value before "value[m.name] = decoded").

  reply	other threads:[~2023-07-13 16:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-13  9:05 [PATCH net-next 0/2] tools: ynl-gen: fix parse multi-attr enum attribute Arkadiusz Kubalewski
2023-07-13  9:05 ` [PATCH net-next 1/2 v2] tools: ynl-gen: fix enum index in _decode_enum(..) Arkadiusz Kubalewski
2023-07-13 16:02   ` Jakub Kicinski
2023-07-18 16:30     ` Kubalewski, Arkadiusz
2023-07-13  9:05 ` [PATCH net-next 2/2 v2] tools: ynl-gen: fix parse multi-attr enum attribute Arkadiusz Kubalewski
2023-07-13 16:08   ` Jakub Kicinski [this message]
2023-07-18 16:56     ` Kubalewski, Arkadiusz

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=20230713090836.13c946bb@kernel.org \
    --to=kuba@kernel.org \
    --cc=arkadiusz.kubalewski@intel.com \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@google.com \
    --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).