[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231004171202.6e52bde3@kernel.org>
Date: Wed, 4 Oct 2023 17:12:02 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Jiri Pirko <jiri@...nulli.us>
Cc: netdev@...r.kernel.org, pabeni@...hat.com, davem@...emloft.net,
edumazet@...gle.com, donald.hunter@...il.com
Subject: Re: [patch net-next v2 1/3] tools: ynl-gen: lift type requirement
for attribute subsets
On Fri, 29 Sep 2023 15:47:40 +0200 Jiri Pirko wrote:
> --- a/tools/net/ynl/ynl-gen-c.py
> +++ b/tools/net/ynl/ynl-gen-c.py
> @@ -723,6 +723,8 @@ class AttrSet(SpecAttrSet):
> self.c_name = ''
>
> def new_attr(self, elem, value):
> + if 'type' not in elem:
> + raise Exception(f"Type has to be set for attribute {elem['name']}")
> if elem['type'] in scalars:
> t = TypeScalar(self.family, self, elem, value)
> elif elem['type'] == 'unused':
Can this still be enforced using JSON schema? Using dependencies
to make sure that if subset-of is not present type is?
Powered by blists - more mailing lists