]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: selftests: clean up tools/testing/selftests/net/lib/py/utils.py
authorBreno Leitao <leitao@debian.org>
Mon, 1 Sep 2025 10:00:07 +0000 (03:00 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 2 Sep 2025 22:51:16 +0000 (15:51 -0700)
commit23313771c7b99b3b8dba169bc71dae619d41ab56
tree533fd3f9737126c68bde95d36a92ab0cc4d69612
parentd250f14f5f0754ce2d05d9c0ce778e4a51f488b0
net: selftests: clean up tools/testing/selftests/net/lib/py/utils.py

This patch improves the utils.py module by removing unused imports
(errno, random), simplifying the fd_read_timeout() function by
eliminating unnecessary else clause, and cleaning up code style in the
defer class constructor.

Additionally, it renames the parameter in rand_port() from 'type' to
'stype' to avoid shadowing the built-in Python name 'type', improving
code clarity and preventing potential issues.

These changes enhance code readability and maintainability without
affecting functionality.

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250901-fix-v1-1-df0abb67481e@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/lib/py/utils.py