Thread (2 messages) 2 messages, 2 authors, 7d ago

[PATCH net-next] selftests: net: Fix minor issues in cork_fragsize.py

flat view
COOLING7d IN NET-NEXT

From: Alice Mikityanska <hidden>
Date: 2026-10-01 12:42:46
Also in: linux-kselftest
Subsystem: kernel selftest framework, networking [general], the rest · Maintainers: Shuah Khan, Shuah Khan, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Queued in net-next as 363cf8def362 on 2026-10-06.

From: Alice Mikityanska <redacted>

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 <redacted>
---
 tools/testing/selftests/net/cork_fragsize.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/net/cork_fragsize.py b/tools/testing/selftests/net/cork_fragsize.py
index 7afd643d07ec..ae6be804b7a2 100755
--- a/tools/testing/selftests/net/cork_fragsize.py
+++ b/tools/testing/selftests/net/cork_fragsize.py
@@ -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:
-- 
2.55.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help