netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Jiri Pirko <jiri@resnulli.us>
Cc: netdev@vger.kernel.org, pabeni@redhat.com, davem@davemloft.net,
	edumazet@google.com, donald.hunter@gmail.com
Subject: Re: [patch net-next v2 1/3] tools: ynl-gen: lift type requirement for attribute subsets
Date: Wed, 4 Oct 2023 17:12:02 -0700	[thread overview]
Message-ID: <20231004171202.6e52bde3@kernel.org> (raw)
In-Reply-To: <20230929134742.1292632-2-jiri@resnulli.us>

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?

  reply	other threads:[~2023-10-05  0:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-29 13:47 [patch net-next v2 0/3] tools: ynl-gen: fix subset attributes handling Jiri Pirko
2023-09-29 13:47 ` [patch net-next v2 1/3] tools: ynl-gen: lift type requirement for attribute subsets Jiri Pirko
2023-10-05  0:12   ` Jakub Kicinski [this message]
2023-10-05  7:23     ` Jiri Pirko
2023-09-29 13:47 ` [patch net-next v2 2/3] netlink: specs: remove redundant type keys from attributes in subsets Jiri Pirko
2023-10-05  0:12   ` Jakub Kicinski
2023-09-29 13:47 ` [patch net-next v2 3/3] tools: ynl-gen: raise exception when subset attribute contains more than "name" key Jiri Pirko
2023-10-05  0:13   ` Jakub Kicinski
2023-10-05  7:25     ` Jiri Pirko
2023-10-05 14:21       ` Jakub Kicinski
2023-10-05 14:50         ` Jiri Pirko

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=20231004171202.6e52bde3@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@google.com \
    --cc=jiri@resnulli.us \
    --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).