The patch titled Subject: list: test: increase coverage of list_test_list_replace*() has been added to the -mm mm-nonmm-unstable branch. Its filename is list-test-increasing-coverage-of-list_test_list_replace.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/list-test-increasing-coverage-of-list_test_list_replace.patch This patch will later appear in the mm-nonmm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: I Hsin Cheng <richard120310@xxxxxxxxx> Subject: list: test: increase coverage of list_test_list_replace*() Date: Tue, 10 Sep 2024 12:08:18 +0800 Increase the test coverage of list_test_list_replace*() by adding the checks to compare the pointer of "a_new.next" and "a_new.prev" to make sure a perfect circular doubly linked list is formed after the replacement. Link: https://lkml.kernel.org/r/20240910040818.65723-1-richard120310@xxxxxxxxx Signed-off-by: I Hsin Cheng <richard120310@xxxxxxxxx> Cc: David Gow <davidgow@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- lib/list-test.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/lib/list-test.c~list-test-increasing-coverage-of-list_test_list_replace +++ a/lib/list-test.c @@ -102,6 +102,8 @@ static void list_test_list_replace(struc /* now: [list] -> a_new -> b */ KUNIT_EXPECT_PTR_EQ(test, list.next, &a_new); KUNIT_EXPECT_PTR_EQ(test, b.prev, &a_new); + KUNIT_EXPECT_PTR_EQ(test, a_new.next, &b); + KUNIT_EXPECT_PTR_EQ(test, a_new.prev, &list); } static void list_test_list_replace_init(struct kunit *test) @@ -118,6 +120,8 @@ static void list_test_list_replace_init( /* now: [list] -> a_new -> b */ KUNIT_EXPECT_PTR_EQ(test, list.next, &a_new); KUNIT_EXPECT_PTR_EQ(test, b.prev, &a_new); + KUNIT_EXPECT_PTR_EQ(test, a_new.next, &b); + KUNIT_EXPECT_PTR_EQ(test, a_new.prev, &list); /* check a_old is empty (initialized) */ KUNIT_EXPECT_TRUE(test, list_empty_careful(&a_old)); _ Patches currently in -mm which might be from richard120310@xxxxxxxxx are list-test-mending-tests-for-list_cut_position.patch list-test-increasing-coverage-of-list_test_list_replace.patch