Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kunit: test.h: solve kernel-doc warnings

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+huawei@kernel.org>

+7 -3
+7 -3
include/kunit/test.h
··· 25 25 /** 26 26 * struct kunit_resource - represents a *test managed resource* 27 27 * @data: for the user to store arbitrary data. 28 + * @name: optional name 28 29 * @free: a user supplied function to free the resource. Populated by 29 30 * kunit_resource_alloc(). 30 31 * ··· 81 80 */ 82 81 struct kunit_resource { 83 82 void *data; 84 - const char *name; /* optional name */ 83 + const char *name; 84 + kunit_resource_free_t free; 85 85 86 86 /* private: internal use only. */ 87 - kunit_resource_free_t free; 88 87 struct kref refcount; 89 88 struct list_head node; 90 89 }; ··· 349 348 * none is supplied, the resource data value is simply set to @data. 350 349 * If an init function is supplied, @data is passed to it instead. 351 350 * @free: a user-supplied function to free the resource (if needed). 351 + * @res: The resource. 352 352 * @data: value to pass to init function or set in resource data field. 353 353 */ 354 354 int kunit_add_resource(struct kunit *test, ··· 363 361 * @test: The test context object. 364 362 * @init: a user-supplied function to initialize the resource data, if needed. 365 363 * @free: a user-supplied function to free the resource data, if needed. 366 - * @name_data: name and data to be set for resource. 364 + * @res: The resource. 365 + * @name: name to be set for resource. 366 + * @data: value to pass to init function or set in resource data field. 367 367 */ 368 368 int kunit_add_named_resource(struct kunit *test, 369 369 kunit_resource_init_t init,