[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230713090836.13c946bb@kernel.org>
Date: Thu, 13 Jul 2023 09:08:36 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Arkadiusz Kubalewski <arkadiusz.kubalewski@...el.com>, Donald Hunter
<donald.hunter@...il.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net, pabeni@...hat.com,
edumazet@...gle.com
Subject: Re: [PATCH net-next 2/2 v2] tools: ynl-gen: fix parse multi-attr
enum attribute
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").
Powered by blists - more mailing lists