All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Linux Doc Mailing List <linux-doc@vger.kernel.org>,
	Jonathan Corbet <corbet@lwn.net>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 22/30] kunit: test.h: solve kernel-doc warnings
Date: Wed,  9 Sep 2020 16:10:53 +0200	[thread overview]
Message-ID: <8fc5501c341836d8591f8dd11721585cc8694d73.1599660067.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1599660067.git.mchehab+huawei@kernel.org>

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>
---
 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


  parent reply	other threads:[~2020-09-09 16:59 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-09 14:10 [PATCH 00/30] docs: fix documentation build parsing errors Mauro Carvalho Chehab
2020-09-09 14:10 ` [PATCH 01/30] .gitignore: docs: ignore sphinx_*/ directories Mauro Carvalho Chehab
2020-09-10 16:53   ` Jonathan Corbet
2020-09-09 14:10 ` [PATCH 02/30] kernel-doc: include line numbers for function prototypes Mauro Carvalho Chehab
2020-09-09 14:10 ` [PATCH 03/30] dt-bindings: fix references to files converted to yaml Mauro Carvalho Chehab
2020-09-09 14:10 ` [PATCH 04/30] docs: hwmon: adm1266.rst: fix a broken reference Mauro Carvalho Chehab
2020-09-09 14:10 ` [PATCH 05/30] docs: scheduler: fix the directory name on two files Mauro Carvalho Chehab
2020-09-09 18:12   ` Valentin Schneider
2020-09-09 14:10 ` [PATCH 06/30] docs: trace: fix the location of kprobes.rst Mauro Carvalho Chehab
2020-09-09 14:10 ` [PATCH 07/30] MAINTAINERS: fix location of qlogic/LICENSE.qla3xxx Mauro Carvalho Chehab
2020-09-09 14:10 ` [PATCH 08/30] docs: fix location of nommu-mmap.rst file Mauro Carvalho Chehab
2020-09-09 14:10 ` [PATCH 09/30] net: appletalk: Kconfig: Fix docs location Mauro Carvalho Chehab
2020-09-09 14:10 ` [PATCH 10/30] drivers: net: hamradio: fix document location Mauro Carvalho Chehab
2020-09-09 14:10 ` [PATCH 11/30] tools: docs: memory-model: fix references for some files Mauro Carvalho Chehab
2020-09-09 14:10 ` [PATCH 12/30] scripts: device_attr_show.cocci: update location of sysfs doc Mauro Carvalho Chehab
2020-09-09 14:10 ` [PATCH 13/30] docs: SafeSetID: fix a warning Mauro Carvalho Chehab
2020-09-09 14:10 ` [PATCH 14/30] docs: add some new files to their respective index.rst files Mauro Carvalho Chehab
2020-09-09 14:10 ` [PATCH 15/30] docs: powerpc: syscall64-abi.rst: fix a malformed table Mauro Carvalho Chehab
2020-09-09 14:10 ` [PATCH 16/30] docs: watch_queue: fix some warnings Mauro Carvalho Chehab
2020-09-09 14:10 ` [PATCH 17/30] docs: kvm: api.rst: add missing spaces Mauro Carvalho Chehab
2020-09-09 14:10 ` [PATCH 18/30] block: bio: fix a warning at the kernel-doc markups Mauro Carvalho Chehab
2020-09-09 14:10 ` [PATCH 19/30] docs: soundwire: fix some identation at stream.rst Mauro Carvalho Chehab
2020-09-09 14:10 ` [PATCH 20/30] docs: dma-buf: fix some warnings Mauro Carvalho Chehab
2020-09-09 14:10 ` [PATCH 21/30] iio: industrialio-core.c: solve a kernel-doc warning Mauro Carvalho Chehab
2020-09-09 14:10 ` Mauro Carvalho Chehab [this message]
2020-09-09 14:10 ` [PATCH 23/30] docs: submitting-patches: use :doc: for references Mauro Carvalho Chehab
2020-09-09 14:10 ` [PATCH 24/30] docs: lockdep-design: fix some warning issues Mauro Carvalho Chehab
2020-09-09 14:10 ` [PATCH 25/30] docs: admin-guide: net.rst: add a missing blank line Mauro Carvalho Chehab
2020-09-09 14:10 ` [PATCH 26/30] iio: iio.h: fix a warning at the kernel-doc markup Mauro Carvalho Chehab
2020-09-11  8:32   ` Jonathan Cameron
2020-09-11 15:40     ` Jonathan Corbet
2020-09-09 14:10 ` [PATCH 27/30] docs: bio: fix a kerneldoc markup Mauro Carvalho Chehab
2020-09-09 14:10 ` [PATCH 28/30] drivers: core: fix kernel-doc markup for dev_err_probe() Mauro Carvalho Chehab
2020-09-09 14:11 ` [PATCH 29/30] kunit: test.h: fix a bad kernel-doc markup Mauro Carvalho Chehab
2020-09-09 14:11 ` [PATCH 30/30] docs: amdgpu: fix a warning when building the documentation Mauro Carvalho Chehab
2020-09-10 16:42 ` [PATCH 00/30] docs: fix documentation build parsing errors Jonathan Corbet
2020-09-11  5:50   ` Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8fc5501c341836d8591f8dd11721585cc8694d73.1599660067.git.mchehab+huawei@kernel.org \
    --to=mchehab+huawei@kernel.org \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.