Skip to contentSkip to conversation

kunit: fix kernel-doc warnings due to mismatched arg names

PATCH In review Daniel Latypov 3 participants 3 messages Oct 5, 2021 – Oct 6, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kunit: fix kernel-doc warnings due to mismatched arg names

Commit 7122debb4367 ("kunit: introduce kunit_kmalloc_array/kunit_kcalloc() helpers") added new functions but called last arg flags, unlike the existing code that used gfp. This only is an issue in test.h, test.c still used gfp.

But the documentation was copy-pasted with the old names, leading to kernel-doc warnings.

Do s/flags/gfp to make the names consistent and fix the warnings.

Fixes 7122debb4367 ("kunit: introduce kunit_kmalloc_array/kunit_kcalloc() helpers")
---
 include/kunit/test.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
include/kunit/test.h +3 -3
index 24b40e5c160b..018e776a34b9 100644
@@ -613,7 +613,7 @@ void kunit_remove_resource(struct kunit *test, struct kunit_resource *res);
  * and is automatically cleaned up after the test case concludes. See &struct
  * kunit_resource for more information.
  */
-void *kunit_kmalloc_array(struct kunit *test, size_t n, size_t size, gfp_t flags);
+void *kunit_kmalloc_array(struct kunit *test, size_t n, size_t size, gfp_t gfp);
 
 /**
  * kunit_kmalloc() - Like kmalloc() except the allocation is *test managed*.
@@ -657,9 +657,9 @@ static inline void *kunit_kzalloc(struct kunit *test, size_t size, gfp_t gfp)
  *
  * See kcalloc() and kunit_kmalloc_array() for more information.
  */
-static inline void *kunit_kcalloc(struct kunit *test, size_t n, size_t size, gfp_t flags)
+static inline void *kunit_kcalloc(struct kunit *test, size_t n, size_t size, gfp_t gfp)
 {
-	return kunit_kmalloc_array(test, n, size, flags | __GFP_ZERO);
+	return kunit_kmalloc_array(test, n, size, gfp | __GFP_ZERO);
 }
 
 void kunit_cleanup(struct kunit *test);

base-commit: 3b29021ddd10cfb6b2565c623595bd3b02036f33

Signature · 1 line
2.33.0.882.g93a45727a2-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Daniel Latypov

Commit 7122debb4367 ("kunit: introduce kunit_kmalloc_array/kunit_kcalloc() helpers") added new functions but called last arg flags, unlike the existing code that used gfp. This only is an issue in test.h, test.c still used gfp.

Quoted 8 lines

But the documentation was copy-pasted with the old names, leading to kernel-doc warnings.

Do s/flags/gfp to make the names consistent and fix the warnings.

Fixes 7122debb4367 ("kunit: introduce kunit_kmalloc_array/kunit_kcalloc() helpers")

Thanks.

Quoted 32 lines
---
  include/kunit/test.h | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
include/kunit/test.h +3 -3
index 24b40e5c160b..018e776a34b9 100644
@@ -613,7 +613,7 @@ void kunit_remove_resource(struct kunit *test, struct kunit_resource *res);
   * and is automatically cleaned up after the test case concludes. See &struct
   * kunit_resource for more information.
   */
-void *kunit_kmalloc_array(struct kunit *test, size_t n, size_t size, gfp_t flags);
+void *kunit_kmalloc_array(struct kunit *test, size_t n, size_t size, gfp_t gfp);
 
  /**
   * kunit_kmalloc() - Like kmalloc() except the allocation is *test managed*.
@@ -657,9 +657,9 @@ static inline void *kunit_kzalloc(struct kunit *test, size_t size, gfp_t gfp)
   *
   * See kcalloc() and kunit_kmalloc_array() for more information.
   */
-static inline void *kunit_kcalloc(struct kunit *test, size_t n, size_t size, gfp_t flags)
+static inline void *kunit_kcalloc(struct kunit *test, size_t n, size_t size, gfp_t gfp)
  {
-	return kunit_kmalloc_array(test, n, size, flags | __GFP_ZERO);
+	return kunit_kmalloc_array(test, n, size, gfp | __GFP_ZERO);
  }
 
  void kunit_cleanup(struct kunit *test);

base-commit: 3b29021ddd10cfb6b2565c623595bd3b02036f33

Signature · 1 line
~Randy
Reviewed-by on v1 1/1
#2 lore raw
In reply to Daniel Latypov
Quoted 6 lines · Daniel Latypov

Commit 7122debb4367 ("kunit: introduce kunit_kmalloc_array/kunit_kcalloc() helpers") added new functions but called last arg flags, unlike the existing code that used gfp. This only is an issue in test.h, test.c still used gfp.

Quoted 8 lines

But the documentation was copy-pasted with the old names, leading to kernel-doc warnings.

Do s/flags/gfp to make the names consistent and fix the warnings.

Fixes 7122debb4367 ("kunit: introduce kunit_kmalloc_array/kunit_kcalloc() helpers")