]> www.infradead.org Git - users/hch/misc.git/commitdiff
tools: ynl: remove assigned but never used variable
authorMatthieu Baerts (NGI0) <matttbe@kernel.org>
Tue, 9 Sep 2025 21:07:49 +0000 (23:07 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 11 Sep 2025 01:08:59 +0000 (18:08 -0700)
These variables are assigned but never used according to Ruff. They can
then be safely removed.

This is linked to Ruff error F841 [1]:

  A variable that is defined but not used is likely a mistake, and
  should be removed to avoid confusion.

Link: https://docs.astral.sh/ruff/rules/unused-variable/
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-3-238c2bccdd99@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/net/ynl/pyynl/ethtool.py
tools/net/ynl/pyynl/ynl_gen_c.py

index 44440beab62f52f240e10f0678a6564f449d26d4..ef2cbad41f9bdd4e22c1be956326417c9ee23109 100755 (executable)
@@ -156,7 +156,6 @@ def main():
     global args
     args = parser.parse_args()
 
-    script_abs_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
     spec = os.path.join(spec_dir(), 'ethtool.yaml')
     schema = os.path.join(schema_dir(), 'genetlink-legacy.yaml')
 
index fb7e03805a1130115ccf70d1e3fbdd6ac485374a..957fae8e27ede6fcd51fb2a98d356a6d67d0352e 100755 (executable)
@@ -2803,8 +2803,6 @@ def print_kernel_policy_sparse_enum_validates(family, cw):
                 cw.p('/* Sparse enums validation callbacks */')
                 first = False
 
-            sign = '' if attr.type[0] == 'u' else '_signed'
-            suffix = 'ULL' if attr.type[0] == 'u' else 'LL'
             cw.write_func_prot('static int', f'{c_lower(attr.enum_name)}_validate',
                                ['const struct nlattr *attr', 'struct netlink_ext_ack *extack'])
             cw.block_start()