selftests: net: Fix minor issues in cork_fragsize.py

return None is unreachable in check_kernel_config, because the try block
always returns a True or False value, and the except block continues the
loop. The return None was supposed to be outside the for loop, to make
pylint happy by making all the flows of the function return a value
explicitly.

While at it, make the docstring of check_dmesg_clean clearer by
explaining the return values.

Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260901195714.673548-1-alice.kernel%40fastmail.im
Signed-off-by: Alice Mikityanska <alice@isovalent.com>
Link: https://patch.msgid.link/20261001124201.584805-1-alice.kernel@fastmail.im
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Alice Mikityanska authored and Jakub Kicinski committed 2026-10-05 17:15:54 -07:00
1 parent 9b84b36a52
commit 363cf8def3
1 file changed
+3 -2
+3 -2
View File
@@ -54,7 +54,7 @@ def check_kernel_config(option: str) -> bool | None:
return False
except OSError:
continue
return None
return None
def assert_debug_kernel() -> None:
@@ -71,7 +71,8 @@ def assert_debug_kernel() -> None:
def check_dmesg_clean(func: str) -> bool:
'''
Check if the given function produced a WARN in dmesg.
Check if the given function produced a WARN in dmesg. Returns True if dmesg
is clean, i.e. doesn't contain traces of a WARNING in the given function.
'''
with subprocess.Popen(['dmesg'], stdout=subprocess.PIPE) as dmesg: