diff options
author | Ingo Molnar <mingo@kernel.org> | 2017-03-05 05:54:46 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-06-20 06:18:29 -0400 |
commit | 939798a072300698870b96756c38bb34c20f6c71 (patch) | |
tree | 31d24914d7d72779ff401a5f4b401a90863864fe | |
parent | 76c85ddc4695bb7b8209bfeff11f5156088f9197 (diff) |
sched/wait: Improve the bit-wait API parameter names in the API function prototypes
Contrary to kernel tradition, most of the bit-wait function prototypes
in <linux/wait.h> don't fully define the parameter names, they only
list the types:
int out_of_line_wait_on_bit_timeout(void *, int, wait_bit_action_f *, unsigned, unsigned long);
... which is pretty passive-aggressive in terms of informing the reader
about what these functions are doing.
Fill in the parameter names, such as:
int out_of_line_wait_on_bit_timeout(void *word, int, wait_bit_action_f *action, unsigned int mode, unsigned long timeout);
Also turn spurious (and inconsistently utilized) cases of 'unsigned' into 'unsigned int'.
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | include/linux/wait.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/include/linux/wait.h b/include/linux/wait.h index fc7c32d82120..1338505d8b9f 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
@@ -200,22 +200,22 @@ __remove_wait_queue(struct wait_queue_head *wq_head, struct wait_queue_entry *wq | |||
200 | list_del(&wq_entry->task_list); | 200 | list_del(&wq_entry->task_list); |
201 | } | 201 | } |
202 | 202 | ||
203 | typedef int wait_bit_action_f(struct wait_bit_key *, int mode); | 203 | typedef int wait_bit_action_f(struct wait_bit_key *key, int mode); |
204 | void __wake_up(struct wait_queue_head *wq_head, unsigned int mode, int nr, void *key); | 204 | void __wake_up(struct wait_queue_head *wq_head, unsigned int mode, int nr, void *key); |
205 | void __wake_up_locked_key(struct wait_queue_head *wq_head, unsigned int mode, void *key); | 205 | void __wake_up_locked_key(struct wait_queue_head *wq_head, unsigned int mode, void *key); |
206 | void __wake_up_sync_key(struct wait_queue_head *wq_head, unsigned int mode, int nr, void *key); | 206 | void __wake_up_sync_key(struct wait_queue_head *wq_head, unsigned int mode, int nr, void *key); |
207 | void __wake_up_locked(struct wait_queue_head *wq_head, unsigned int mode, int nr); | 207 | void __wake_up_locked(struct wait_queue_head *wq_head, unsigned int mode, int nr); |
208 | void __wake_up_sync(struct wait_queue_head *wq_head, unsigned int mode, int nr); | 208 | void __wake_up_sync(struct wait_queue_head *wq_head, unsigned int mode, int nr); |
209 | void __wake_up_bit(struct wait_queue_head *, void *, int); | 209 | void __wake_up_bit(struct wait_queue_head *wq_head, void *word, int bit); |
210 | int __wait_on_bit(struct wait_queue_head *, struct wait_bit_queue_entry *, wait_bit_action_f *, unsigned); | 210 | int __wait_on_bit(struct wait_queue_head *wq_head, struct wait_bit_queue_entry *wbq_entry, wait_bit_action_f *action, unsigned int mode); |
211 | int __wait_on_bit_lock(struct wait_queue_head *, struct wait_bit_queue_entry *, wait_bit_action_f *, unsigned); | 211 | int __wait_on_bit_lock(struct wait_queue_head *wq_head, struct wait_bit_queue_entry *wbq_entry, wait_bit_action_f *action, unsigned int mode); |
212 | void wake_up_bit(void *, int); | 212 | void wake_up_bit(void *word, int bit); |
213 | void wake_up_atomic_t(atomic_t *); | 213 | void wake_up_atomic_t(atomic_t *p); |
214 | int out_of_line_wait_on_bit(void *, int, wait_bit_action_f *, unsigned); | 214 | int out_of_line_wait_on_bit(void *word, int, wait_bit_action_f *action, unsigned int mode); |
215 | int out_of_line_wait_on_bit_timeout(void *, int, wait_bit_action_f *, unsigned, unsigned long); | 215 | int out_of_line_wait_on_bit_timeout(void *word, int, wait_bit_action_f *action, unsigned int mode, unsigned long timeout); |
216 | int out_of_line_wait_on_bit_lock(void *, int, wait_bit_action_f *, unsigned); | 216 | int out_of_line_wait_on_bit_lock(void *word, int, wait_bit_action_f *action, unsigned int mode); |
217 | int out_of_line_wait_on_atomic_t(atomic_t *, int (*)(atomic_t *), unsigned); | 217 | int out_of_line_wait_on_atomic_t(atomic_t *p, int (*)(atomic_t *), unsigned int mode); |
218 | struct wait_queue_head *bit_waitqueue(void *, int); | 218 | struct wait_queue_head *bit_waitqueue(void *word, int bit); |
219 | 219 | ||
220 | #define wake_up(x) __wake_up(x, TASK_NORMAL, 1, NULL) | 220 | #define wake_up(x) __wake_up(x, TASK_NORMAL, 1, NULL) |
221 | #define wake_up_nr(x, nr) __wake_up(x, TASK_NORMAL, nr, NULL) | 221 | #define wake_up_nr(x, nr) __wake_up(x, TASK_NORMAL, nr, NULL) |
@@ -1008,10 +1008,10 @@ int wake_bit_function(struct wait_queue_entry *wq_entry, unsigned mode, int sync | |||
1008 | } while (0) | 1008 | } while (0) |
1009 | 1009 | ||
1010 | 1010 | ||
1011 | extern int bit_wait(struct wait_bit_key *, int); | 1011 | extern int bit_wait(struct wait_bit_key *key, int bit); |
1012 | extern int bit_wait_io(struct wait_bit_key *, int); | 1012 | extern int bit_wait_io(struct wait_bit_key *key, int bit); |
1013 | extern int bit_wait_timeout(struct wait_bit_key *, int); | 1013 | extern int bit_wait_timeout(struct wait_bit_key *key, int bit); |
1014 | extern int bit_wait_io_timeout(struct wait_bit_key *, int); | 1014 | extern int bit_wait_io_timeout(struct wait_bit_key *key, int bit); |
1015 | 1015 | ||
1016 | /** | 1016 | /** |
1017 | * wait_on_bit - wait for a bit to be cleared | 1017 | * wait_on_bit - wait for a bit to be cleared |