netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
	chuck.lever@oracle.com, Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net 1/3] tools: ynl: make definitions optional again
Date: Wed, 15 Mar 2023 16:03:49 -0700	[thread overview]
Message-ID: <20230315230351.478320-2-kuba@kernel.org> (raw)
In-Reply-To: <20230315230351.478320-1-kuba@kernel.org>

definitions are optional, commit in question breaks cli for ethtool.

Fixes: 6517a60b0307 ("tools: ynl: move the enum classes to shared code")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 tools/net/ynl/lib/nlspec.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/net/ynl/lib/nlspec.py b/tools/net/ynl/lib/nlspec.py
index 960a356e8225..e01a72d06638 100644
--- a/tools/net/ynl/lib/nlspec.py
+++ b/tools/net/ynl/lib/nlspec.py
@@ -387,7 +387,8 @@ jsonschema = None
     def resolve(self):
         self.resolve_up(super())
 
-        for elem in self.yaml['definitions']:
+        definitions = self.yaml.get('definitions', [])
+        for elem in definitions:
             if elem['type'] == 'enum' or elem['type'] == 'flags':
                 self.consts[elem['name']] = self.new_enum(elem)
             else:
-- 
2.39.2


  reply	other threads:[~2023-03-15 23:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-15 23:03 [PATCH net 0/3] ynl: another license adjustment Jakub Kicinski
2023-03-15 23:03 ` Jakub Kicinski [this message]
2023-03-15 23:03 ` [PATCH net 2/3] ynl: broaden the license even more Jakub Kicinski
2023-03-15 23:03 ` [PATCH net 3/3] ynl: make the tooling check the license Jakub Kicinski
2023-03-15 23:53 ` [PATCH net 0/3] ynl: another license adjustment Chuck Lever III
2023-03-17  4: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=20230315230351.478320-2-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=davem@davemloft.net \
    --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).