aboutsummaryrefslogtreecommitdiffstats
path: root/tools/net/ynl/pyynl/ynl_gen_c.py
diff options
context:
space:
mode:
authorMatthieu Baerts (NGI0) <matttbe@kernel.org>2025-09-09 23:07:51 +0200
committerJakub Kicinski <kuba@kernel.org>2025-09-10 18:08:59 -0700
commit389712b0da1f0af9ef28b3d8f9b18e41f92ade28 (patch)
tree289fc76c13350fb9768b54175607a511821fbad9 /tools/net/ynl/pyynl/ynl_gen_c.py
parenttools: ynl: remove f-string without any placeholders (diff)
downloadlinux-389712b0da1f0af9ef28b3d8f9b18e41f92ade28.tar.gz
linux-389712b0da1f0af9ef28b3d8f9b18e41f92ade28.zip
tools: ynl: remove unused imports
These imports are not used according to Ruff, and can be safely removed. This is linked to Ruff error F401 [1]: Unused imports add a performance overhead at runtime, and risk creating import cycles. They also increase the cognitive load of reading the code. There is one exception with 'YnlDocGenerator' which is added in __all__: it is used by ynl_gen_rst.py. Link: https://docs.astral.sh/ruff/rules/unused-import/ [1] Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Reviewed-by: Asbjørn Sloth Tønnesen <ast@fiberby.net> Link: https://patch.msgid.link/20250909-net-next-ynl-ruff-v1-5-238c2bccdd99@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/net/ynl/pyynl/ynl_gen_c.py')
-rwxr-xr-xtools/net/ynl/pyynl/ynl_gen_c.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/net/ynl/pyynl/ynl_gen_c.py b/tools/net/ynl/pyynl/ynl_gen_c.py
index 8e95c5bb1399..5113cf1787f6 100755
--- a/tools/net/ynl/pyynl/ynl_gen_c.py
+++ b/tools/net/ynl/pyynl/ynl_gen_c.py
@@ -2,7 +2,6 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
import argparse
-import collections
import filecmp
import pathlib
import os
@@ -14,7 +13,7 @@ import yaml
sys.path.append(pathlib.Path(__file__).resolve().parent.as_posix())
from lib import SpecFamily, SpecAttrSet, SpecAttr, SpecOperation, SpecEnumSet, SpecEnumEntry
-from lib import SpecSubMessage, SpecSubMessageFormat
+from lib import SpecSubMessage
def c_upper(name):