From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Linux Doc Mailing List <linux-doc@vger.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
"Joel Fernandes (Google)" <joel@joelfernandes.org>,
"Jonathan Corbet" <corbet@lwn.net>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
Davidlohr Bueso <dbueso@suse.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
linux-kernel@vger.kernel.org
Subject: [PATCH v4 14/27] completion: fix kernel-doc markups
Date: Mon, 16 Nov 2020 11:18:10 +0100 [thread overview]
Message-ID: <3540741143ee102db25283454e962768a8d6b9dd.1605521731.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1605521731.git.mchehab+huawei@kernel.org>
Kernel-doc only supports having the comment just before
the identifier.
The markup for init_completion is actually for
__init_completion.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
Thats said, IMHO, it would make sense to simply
rename __init_completion() to init_completion() and drop
this define:
#define init_completion(x) __init_completion(x)
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
include/linux/completion.h | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/include/linux/completion.h b/include/linux/completion.h
index bf8e77001f18..ff354918dbf4 100644
--- a/include/linux/completion.h
+++ b/include/linux/completion.h
@@ -12,40 +12,48 @@
#include <linux/swait.h>
/*
* struct completion - structure used to maintain state for a "completion"
*
* This is the opaque structure used to maintain the state for a "completion".
* Completions currently use a FIFO to queue threads that have to wait for
* the "completion" event.
*
* See also: complete(), wait_for_completion() (and friends _timeout,
* _interruptible, _interruptible_timeout, and _killable), init_completion(),
* reinit_completion(), and macros DECLARE_COMPLETION(),
* DECLARE_COMPLETION_ONSTACK().
*/
struct completion {
unsigned int done;
struct swait_queue_head wait;
};
#define init_completion_map(x, m) __init_completion(x)
+
+/**
+ * init_completion - Initialize a dynamically allocated completion
+ * @x: pointer to completion structure that is to be initialized
+ *
+ * This macro will initialize a dynamically created completion
+ * structure.
+ */
#define init_completion(x) __init_completion(x)
static inline void complete_acquire(struct completion *x) {}
static inline void complete_release(struct completion *x) {}
#define COMPLETION_INITIALIZER(work) \
{ 0, __SWAIT_QUEUE_HEAD_INITIALIZER((work).wait) }
#define COMPLETION_INITIALIZER_ONSTACK_MAP(work, map) \
(*({ init_completion_map(&(work), &(map)); &(work); }))
#define COMPLETION_INITIALIZER_ONSTACK(work) \
(*({ init_completion(&work); &work; }))
/**
* DECLARE_COMPLETION - declare and initialize a completion structure
* @work: identifier for the completion structure
*
* This macro declares and initializes a completion structure. Generally used
* for static declarations. You should use the _ONSTACK variant for automatic
* variables.
@@ -59,41 +67,41 @@ static inline void complete_release(struct completion *x) {}
* are on the kernel stack:
*/
/**
* DECLARE_COMPLETION_ONSTACK - declare and initialize a completion structure
* @work: identifier for the completion structure
*
* This macro declares and initializes a completion structure on the kernel
* stack.
*/
#ifdef CONFIG_LOCKDEP
# define DECLARE_COMPLETION_ONSTACK(work) \
struct completion work = COMPLETION_INITIALIZER_ONSTACK(work)
# define DECLARE_COMPLETION_ONSTACK_MAP(work, map) \
struct completion work = COMPLETION_INITIALIZER_ONSTACK_MAP(work, map)
#else
# define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work)
# define DECLARE_COMPLETION_ONSTACK_MAP(work, map) DECLARE_COMPLETION(work)
#endif
/**
- * init_completion - Initialize a dynamically allocated completion
+ * __init_completion - Initialize a dynamically allocated completion
* @x: pointer to completion structure that is to be initialized
*
* This inline function will initialize a dynamically created completion
* structure.
*/
static inline void __init_completion(struct completion *x)
{
x->done = 0;
init_swait_queue_head(&x->wait);
}
/**
* reinit_completion - reinitialize a completion structure
* @x: pointer to completion structure that is to be reinitialized
*
* This inline function should be used to reinitialize a completion structure so it can
* be reused. This is especially important after complete_all() is used.
*/
static inline void reinit_completion(struct completion *x)
{
--
2.28.0
next prev parent reply other threads:[~2020-11-16 11:19 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-16 10:17 [PATCH v4 00/27]Fix several bad kernel-doc markups Mauro Carvalho Chehab
2020-11-16 10:17 ` [PATCH v4 01/27] net: phy: fix " Mauro Carvalho Chehab
2020-11-16 10:17 ` [PATCH v4 02/27] net: datagram: fix some " Mauro Carvalho Chehab
2020-11-16 10:20 ` Kirill Tkhai
2020-11-16 10:17 ` [PATCH v4 03/27] net: core: " Mauro Carvalho Chehab
2020-11-16 10:18 ` [PATCH v4 04/27] s390: fix " Mauro Carvalho Chehab
2020-11-16 10:25 ` Cornelia Huck
2020-11-16 10:38 ` Vineeth Vijayan
2020-11-16 12:04 ` Vineeth Vijayan
2020-11-16 10:18 ` [PATCH v4 05/27] drm: fix some " Mauro Carvalho Chehab
2020-11-16 11:37 ` Jani Nikula
2020-11-16 19:48 ` Daniel Vetter
2020-11-16 10:18 ` [PATCH v4 06/27] HSI: fix a kernel-doc markup Mauro Carvalho Chehab
2020-11-16 10:18 ` [PATCH v4 07/27] IB: fix kernel-doc markups Mauro Carvalho Chehab
2020-11-16 10:36 ` Gustavo A. R. Silva
2020-11-23 23:45 ` Jason Gunthorpe
2020-12-01 11:39 ` Mauro Carvalho Chehab
2020-11-16 10:18 ` [PATCH v4 08/27] parport: fix a kernel-doc markup Mauro Carvalho Chehab
2020-11-16 10:18 ` [PATCH v4 09/27] rapidio: fix kernel-doc a markup Mauro Carvalho Chehab
2020-11-16 10:18 ` [PATCH v4 10/27] video: fix some kernel-doc markups Mauro Carvalho Chehab
2020-11-16 15:36 ` Daniel Vetter
2020-11-16 16:38 ` Mauro Carvalho Chehab
2020-11-16 17:24 ` Daniel Vetter
2020-11-16 18:11 ` Sam Ravnborg
2020-11-16 19:43 ` Daniel Vetter
2020-11-16 18:42 ` Mauro Carvalho Chehab
2020-11-16 10:18 ` [PATCH v4 11/27] fs: fix " Mauro Carvalho Chehab
2020-11-16 10:18 ` [PATCH v4 12/27] jbd2: " Mauro Carvalho Chehab
2020-11-20 3:38 ` Theodore Y. Ts'o
2020-11-16 10:18 ` [PATCH v4 13/27] pstore/zone: fix a kernel-doc markup Mauro Carvalho Chehab
2020-11-16 10:18 ` Mauro Carvalho Chehab [this message]
2020-11-16 11:36 ` [PATCH v4 14/27] completion: fix kernel-doc markups Peter Zijlstra
2020-11-16 10:18 ` [PATCH v4 15/27] firmware: stratix10-svc: " Mauro Carvalho Chehab
2020-11-16 10:18 ` [PATCH v4 16/27] connector: fix a kernel-doc markup Mauro Carvalho Chehab
2020-11-16 10:18 ` [PATCH v4 17/27] lib/crc7: " Mauro Carvalho Chehab
2020-11-16 10:18 ` [PATCH v4 18/27] hrtimer: fix kernel-doc markups Mauro Carvalho Chehab
2020-11-16 10:18 ` [PATCH v4 19/27] genirq: " Mauro Carvalho Chehab
2020-11-16 10:18 ` [PATCH v4 20/27] list: fix a typo at the kernel-doc markup Mauro Carvalho Chehab
2020-11-16 19:57 ` Paul E. McKenney
2020-11-16 10:18 ` [PATCH v4 21/27] memblock: fix kernel-doc markups Mauro Carvalho Chehab
2020-11-16 10:18 ` [PATCH v4 22/27] w1: fix a kernel-doc markup Mauro Carvalho Chehab
2020-11-16 10:18 ` [PATCH v4 23/27] resource: fix kernel-doc markups Mauro Carvalho Chehab
2020-11-16 10:18 ` [PATCH v4 24/27] shed: fix kernel-doc markup Mauro Carvalho Chehab
2020-11-16 12:34 ` Vincent Guittot
2020-11-16 10:18 ` [PATCH v4 25/27] mm: fix kernel-doc markups Mauro Carvalho Chehab
2020-11-16 10:18 ` [PATCH v4 26/27] selftests: kselftest_harness.h: partially " Mauro Carvalho Chehab
2020-11-16 10:18 ` [PATCH v4 27/27] scripts: kernel-doc: validate kernel-doc markup with the actual names Mauro Carvalho Chehab
2020-11-16 15:06 ` kernel test robot
2020-11-16 15:42 ` kernel test robot
2020-11-16 15:51 ` kernel test robot
2020-11-17 22:19 ` [PATCH v4 00/27]Fix several bad kernel-doc markups Jakub Kicinski
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=3540741143ee102db25283454e962768a8d6b9dd.1605521731.git.mchehab+huawei@kernel.org \
--to=mchehab+huawei@kernel.org \
--cc=corbet@lwn.net \
--cc=dbueso@suse.de \
--cc=gregkh@linuxfoundation.org \
--cc=joel@joelfernandes.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).