2024-03-01 19:43:28

by Mickaël Salaün

[permalink] [raw]
Subject: [PATCH v2 5/7] kunit: Fix KUNIT_SUCCESS() calls in iov_iter tests

Fix KUNIT_SUCCESS() calls to pass a test argument.

This is a no-op for now because this macro does nothing, but it will be
required for the next commit.

Cc: Brendan Higgins <[email protected]>
Cc: David Gow <[email protected]>
Cc: Rae Moar <[email protected]>
Cc: Shuah Khan <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
Signed-off-by: Mickaël Salaün <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---

Changes since v1:
* Added Kees's Reviewed-by.
---
lib/kunit_iov_iter.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/lib/kunit_iov_iter.c b/lib/kunit_iov_iter.c
index 859b67c4d697..27e0c8ee71d8 100644
--- a/lib/kunit_iov_iter.c
+++ b/lib/kunit_iov_iter.c
@@ -139,7 +139,7 @@ static void __init iov_kunit_copy_to_kvec(struct kunit *test)
return;
}

- KUNIT_SUCCEED();
+ KUNIT_SUCCEED(test);
}

/*
@@ -194,7 +194,7 @@ static void __init iov_kunit_copy_from_kvec(struct kunit *test)
return;
}

- KUNIT_SUCCEED();
+ KUNIT_SUCCEED(test);
}

struct bvec_test_range {
@@ -302,7 +302,7 @@ static void __init iov_kunit_copy_to_bvec(struct kunit *test)
return;
}

- KUNIT_SUCCEED();
+ KUNIT_SUCCEED(test);
}

/*
@@ -359,7 +359,7 @@ static void __init iov_kunit_copy_from_bvec(struct kunit *test)
return;
}

- KUNIT_SUCCEED();
+ KUNIT_SUCCEED(test);
}

static void iov_kunit_destroy_xarray(void *data)
@@ -453,7 +453,7 @@ static void __init iov_kunit_copy_to_xarray(struct kunit *test)
return;
}

- KUNIT_SUCCEED();
+ KUNIT_SUCCEED(test);
}

/*
@@ -516,7 +516,7 @@ static void __init iov_kunit_copy_from_xarray(struct kunit *test)
return;
}

- KUNIT_SUCCEED();
+ KUNIT_SUCCEED(test);
}

/*
@@ -596,7 +596,7 @@ static void __init iov_kunit_extract_pages_kvec(struct kunit *test)
stop:
KUNIT_EXPECT_EQ(test, size, 0);
KUNIT_EXPECT_EQ(test, iter.count, 0);
- KUNIT_SUCCEED();
+ KUNIT_SUCCEED(test);
}

/*
@@ -674,7 +674,7 @@ static void __init iov_kunit_extract_pages_bvec(struct kunit *test)
stop:
KUNIT_EXPECT_EQ(test, size, 0);
KUNIT_EXPECT_EQ(test, iter.count, 0);
- KUNIT_SUCCEED();
+ KUNIT_SUCCEED(test);
}

/*
@@ -753,7 +753,7 @@ static void __init iov_kunit_extract_pages_xarray(struct kunit *test)
}

stop:
- KUNIT_SUCCEED();
+ KUNIT_SUCCEED(test);
}

static struct kunit_case __refdata iov_kunit_cases[] = {
--
2.44.0



2024-03-12 04:54:59

by David Gow

[permalink] [raw]
Subject: Re: [PATCH v2 5/7] kunit: Fix KUNIT_SUCCESS() calls in iov_iter tests

On Sat, 2 Mar 2024 at 03:40, Mickaël Salaün <[email protected]> wrote:
>
> Fix KUNIT_SUCCESS() calls to pass a test argument.
>
> This is a no-op for now because this macro does nothing, but it will be
> required for the next commit.
>
> Cc: Brendan Higgins <[email protected]>
> Cc: David Gow <[email protected]>
> Cc: Rae Moar <[email protected]>
> Cc: Shuah Khan <[email protected]>
> Reviewed-by: Kees Cook <[email protected]>
> Signed-off-by: Mickaël Salaün <[email protected]>
> Link: https://lore.kernel.org/r/[email protected]
> ---

This is a pretty straightforward fix.

I'm actually a bit surprised how many tests were actually using
KUNIT_SUCCEEDED().

Reviewed-by: David Gow <[email protected]>

Thanks,
-- David


-- David


>
> Changes since v1:
> * Added Kees's Reviewed-by.
> ---
> lib/kunit_iov_iter.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/lib/kunit_iov_iter.c b/lib/kunit_iov_iter.c
> index 859b67c4d697..27e0c8ee71d8 100644
> --- a/lib/kunit_iov_iter.c
> +++ b/lib/kunit_iov_iter.c
> @@ -139,7 +139,7 @@ static void __init iov_kunit_copy_to_kvec(struct kunit *test)
> return;
> }
>
> - KUNIT_SUCCEED();
> + KUNIT_SUCCEED(test);
> }
>
> /*
> @@ -194,7 +194,7 @@ static void __init iov_kunit_copy_from_kvec(struct kunit *test)
> return;
> }
>
> - KUNIT_SUCCEED();
> + KUNIT_SUCCEED(test);
> }
>
> struct bvec_test_range {
> @@ -302,7 +302,7 @@ static void __init iov_kunit_copy_to_bvec(struct kunit *test)
> return;
> }
>
> - KUNIT_SUCCEED();
> + KUNIT_SUCCEED(test);
> }
>
> /*
> @@ -359,7 +359,7 @@ static void __init iov_kunit_copy_from_bvec(struct kunit *test)
> return;
> }
>
> - KUNIT_SUCCEED();
> + KUNIT_SUCCEED(test);
> }
>
> static void iov_kunit_destroy_xarray(void *data)
> @@ -453,7 +453,7 @@ static void __init iov_kunit_copy_to_xarray(struct kunit *test)
> return;
> }
>
> - KUNIT_SUCCEED();
> + KUNIT_SUCCEED(test);
> }
>
> /*
> @@ -516,7 +516,7 @@ static void __init iov_kunit_copy_from_xarray(struct kunit *test)
> return;
> }
>
> - KUNIT_SUCCEED();
> + KUNIT_SUCCEED(test);
> }
>
> /*
> @@ -596,7 +596,7 @@ static void __init iov_kunit_extract_pages_kvec(struct kunit *test)
> stop:
> KUNIT_EXPECT_EQ(test, size, 0);
> KUNIT_EXPECT_EQ(test, iter.count, 0);
> - KUNIT_SUCCEED();
> + KUNIT_SUCCEED(test);
> }
>
> /*
> @@ -674,7 +674,7 @@ static void __init iov_kunit_extract_pages_bvec(struct kunit *test)
> stop:
> KUNIT_EXPECT_EQ(test, size, 0);
> KUNIT_EXPECT_EQ(test, iter.count, 0);
> - KUNIT_SUCCEED();
> + KUNIT_SUCCEED(test);
> }
>
> /*
> @@ -753,7 +753,7 @@ static void __init iov_kunit_extract_pages_xarray(struct kunit *test)
> }
>
> stop:
> - KUNIT_SUCCEED();
> + KUNIT_SUCCEED(test);
> }
>
> static struct kunit_case __refdata iov_kunit_cases[] = {
> --
> 2.44.0
>


Attachments:
smime.p7s (3.92 kB)
S/MIME Cryptographic Signature