From: Greg Kroah-Hartman Date: Mon, 6 Jun 2022 17:43:55 +0000 (+0200) Subject: 5.15-stable patches X-Git-Tag: v5.10.121~54 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=305b8aabdcdf83fa7ac374bc76a62043c02fd645;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: list-test-add-a-test-for-list_is_head.patch --- diff --git a/queue-5.15/list-test-add-a-test-for-list_is_head.patch b/queue-5.15/list-test-add-a-test-for-list_is_head.patch new file mode 100644 index 00000000000..344f1618bf2 --- /dev/null +++ b/queue-5.15/list-test-add-a-test-for-list_is_head.patch @@ -0,0 +1,60 @@ +From 37dc573c0a547e1aed0c9abb480fab797bd3833f Mon Sep 17 00:00:00 2001 +From: David Gow +Date: Fri, 25 Feb 2022 10:52:48 +0800 +Subject: list: test: Add a test for list_is_head() + +From: David Gow + +commit 37dc573c0a547e1aed0c9abb480fab797bd3833f upstream. + +list_is_head() was added recently[1], and didn't have a KUnit test. The +implementation is trivial, so it's not a particularly exciting test, but +it'd be nice to get back to full coverage of the list functions. + +[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/include/linux/list.h?id=0425473037db40d9e322631f2d4dc6ef51f97e88 + +Signed-off-by: David Gow +Acked-by: Daniel Latypov +Acked-by: Brendan Higgins +Reviewed-by: Andy Shevchenko +Signed-off-by: Shuah Khan +Signed-off-by: Greg Kroah-Hartman +--- + lib/list-test.c | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +--- a/lib/list-test.c ++++ b/lib/list-test.c +@@ -234,6 +234,24 @@ static void list_test_list_bulk_move_tai + KUNIT_EXPECT_EQ(test, i, 2); + } + ++static void list_test_list_is_head(struct kunit *test) ++{ ++ struct list_head a, b, c; ++ ++ /* Two lists: [a] -> b, [c] */ ++ INIT_LIST_HEAD(&a); ++ INIT_LIST_HEAD(&c); ++ list_add_tail(&b, &a); ++ ++ KUNIT_EXPECT_TRUE_MSG(test, list_is_head(&a, &a), ++ "Head element of same list"); ++ KUNIT_EXPECT_FALSE_MSG(test, list_is_head(&a, &b), ++ "Non-head element of same list"); ++ KUNIT_EXPECT_FALSE_MSG(test, list_is_head(&a, &c), ++ "Head element of different list"); ++} ++ ++ + static void list_test_list_is_first(struct kunit *test) + { + struct list_head a, b; +@@ -710,6 +728,7 @@ static struct kunit_case list_test_cases + KUNIT_CASE(list_test_list_move), + KUNIT_CASE(list_test_list_move_tail), + KUNIT_CASE(list_test_list_bulk_move_tail), ++ KUNIT_CASE(list_test_list_is_head), + KUNIT_CASE(list_test_list_is_first), + KUNIT_CASE(list_test_list_is_last), + KUNIT_CASE(list_test_list_empty), diff --git a/queue-5.15/series b/queue-5.15/series index 639c6c3e565..0452b0f8f9d 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -649,3 +649,4 @@ phy-qcom-qmp-fix-reset-controller-leak-on-probe-errors.patch net-ipa-fix-page-free-in-ipa_endpoint_trans_release.patch net-ipa-fix-page-free-in-ipa_endpoint_replenish_one.patch kseltest-cgroup-make-test_stress.sh-work-if-run-interactively.patch +list-test-add-a-test-for-list_is_head.patch