Merge branch 'tools-ynl-gen-fix-glitches-found-by-chuck'

Jakub Kicinski says:

====================
tools: ynl-gen: fix glitches found by Chuck

A handful of fixes Chuck run into while trying to define the family
for crypto handshakes.
====================

Link: https://lore.kernel.org/r/20230223183141.1422857-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Jakub Kicinski 2023-02-24 11:55:49 -08:00
commit 766d1bdceb
3 changed files with 3 additions and 4 deletions

1
tools/net/ynl/lib/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
__pycache__/

View File

@ -3,7 +3,6 @@
import collections
import importlib
import os
import traceback
import yaml
@ -234,8 +233,7 @@ class SpecFamily(SpecElement):
resolved.append(elem)
if len(resolved) == 0:
traceback.print_exception(last_exception)
raise Exception("Could not resolve any spec element, infinite loop?")
raise last_exception
def new_attr_set(self, elem):
return SpecAttrSet(self, elem)

View File

@ -546,7 +546,7 @@ class Struct:
max_val = 0
self.attr_max_val = None
for name, attr in self.attr_list:
if attr.value > max_val:
if attr.value >= max_val:
max_val = attr.value
self.attr_max_val = attr
self.attrs[name] = attr