There are some warnings there:
        ./include/kunit/test.h:90: warning: Function parameter or member 'name' 
not described in 'kunit_resource'
        ./include/kunit/test.h:353: warning: Function parameter or member 'res' 
not described in 'kunit_add_resource'
        ./include/kunit/test.h:367: warning: Function parameter or member 'res' 
not described in 'kunit_add_named_resource'
        ./include/kunit/test.h:367: warning: Function parameter or member 
'name' not described in 'kunit_add_named_resource'
        ./include/kunit/test.h:367: warning: Function parameter or member 
'data' not described in 'kunit_add_named_resource'
        ./include/kunit/test.h:367: warning: Excess function parameter 
'name_data' description in 'kunit_add_named_resource'

Address them, ensuring that all non-private arguments will
be properly described. With that regards, at struct kunit_resource,
the free argument is described as user-provided. So, this
doesn't seem to belong to the "private" part of the struct.

Signed-off-by: Mauro Carvalho Chehab <mchehab+hua...@kernel.org>
---
 include/kunit/test.h | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/include/kunit/test.h b/include/kunit/test.h
index 59f3144f009a..41b3a266bf8c 100644
--- a/include/kunit/test.h
+++ b/include/kunit/test.h
@@ -25,6 +25,7 @@ typedef void (*kunit_resource_free_t)(struct kunit_resource 
*);
 /**
  * struct kunit_resource - represents a *test managed resource*
  * @data: for the user to store arbitrary data.
+ * @name: optional name
  * @free: a user supplied function to free the resource. Populated by
  * kunit_resource_alloc().
  *
@@ -80,10 +81,10 @@ typedef void (*kunit_resource_free_t)(struct kunit_resource 
*);
  */
 struct kunit_resource {
        void *data;
-       const char *name;               /* optional name */
-
-       /* private: internal use only. */
+       const char *name;
        kunit_resource_free_t free;
+
+       /* private: internal use only. */
        struct kref refcount;
        struct list_head node;
 };
@@ -343,6 +344,7 @@ static inline void kunit_put_resource(struct kunit_resource 
*res)
  *        none is supplied, the resource data value is simply set to @data.
  *       If an init function is supplied, @data is passed to it instead.
  * @free: a user-supplied function to free the resource (if needed).
+ * @res: The resource.
  * @data: value to pass to init function or set in resource data field.
  */
 int kunit_add_resource(struct kunit *test,
@@ -356,7 +358,9 @@ int kunit_add_resource(struct kunit *test,
  * @test: The test context object.
  * @init: a user-supplied function to initialize the resource data, if needed.
  * @free: a user-supplied function to free the resource data, if needed.
- * @name_data: name and data to be set for resource.
+ * @res: The resource.
+ * @name: name to be set for resource.
+ * @data: value to pass to init function or set in resource data field.
  */
 int kunit_add_named_resource(struct kunit *test,
                             kunit_resource_init_t init,
-- 
2.26.2

Reply via email to