Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b6a4ae76 authored by Boqun Feng's avatar Boqun Feng Committed by Paul E. McKenney
Browse files

rcu: Use rcu_callback_t in call_rcu*() and friends



As we now have rcu_callback_t typedefs as the type of rcu callbacks, we
should use it in call_rcu*() and friends as the type of parameters. This
could save us a few lines of code and make it clear which function
requires an rcu callbacks rather than other callbacks as its argument.

Besides, this can also help cscope to generate a better database for
code reading.

Signed-off-by: default avatarBoqun Feng <boqun.feng@gmail.com>
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: default avatarJosh Triplett <josh@joshtriplett.org>
parent 84778472
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ void do_trace_rcu_torture_read(const char *rcutorturename,
 * more than one CPU).
 */
void call_rcu(struct rcu_head *head,
	      void (*func)(struct rcu_head *head));
	      rcu_callback_t func);

#else /* #ifdef CONFIG_PREEMPT_RCU */

@@ -191,7 +191,7 @@ void call_rcu(struct rcu_head *head,
 * memory ordering guarantees.
 */
void call_rcu_bh(struct rcu_head *head,
		 void (*func)(struct rcu_head *head));
		 rcu_callback_t func);

/**
 * call_rcu_sched() - Queue an RCU for invocation after sched grace period.
@@ -213,7 +213,7 @@ void call_rcu_bh(struct rcu_head *head,
 * memory ordering guarantees.
 */
void call_rcu_sched(struct rcu_head *head,
		    void (*func)(struct rcu_head *rcu));
		    rcu_callback_t func);

void synchronize_sched(void);

@@ -274,7 +274,7 @@ do { \
 * See the description of call_rcu() for more detailed information on
 * memory ordering guarantees.
 */
void call_rcu_tasks(struct rcu_head *head, void (*func)(struct rcu_head *head));
void call_rcu_tasks(struct rcu_head *head, rcu_callback_t func);
void synchronize_rcu_tasks(void);
void rcu_barrier_tasks(void);

@@ -1065,7 +1065,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
#define __kfree_rcu(head, offset) \
	do { \
		BUILD_BUG_ON(!__is_kfree_rcu_offset(offset)); \
		kfree_call_rcu(head, (void (*)(struct rcu_head *))(unsigned long)(offset)); \
		kfree_call_rcu(head, (rcu_callback_t)(unsigned long)(offset)); \
	} while (0)

/**
+1 −1
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ static inline void synchronize_sched_expedited(void)
}

static inline void kfree_call_rcu(struct rcu_head *head,
				  void (*func)(struct rcu_head *rcu))
				  rcu_callback_t func)
{
	call_rcu(head, func);
}
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ void synchronize_rcu_bh(void);
void synchronize_sched_expedited(void);
void synchronize_rcu_expedited(void);

void kfree_call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu));
void kfree_call_rcu(struct rcu_head *head, rcu_callback_t func);

/**
 * synchronize_rcu_bh_expedited - Brute-force RCU-bh grace period
+2 −2
Original line number Diff line number Diff line
@@ -448,7 +448,7 @@ static void synchronize_rcu_busted(void)
}

static void
call_rcu_busted(struct rcu_head *head, void (*func)(struct rcu_head *rcu))
call_rcu_busted(struct rcu_head *head, rcu_callback_t func)
{
	/* This is a deliberate bug for testing purposes only! */
	func(head);
@@ -523,7 +523,7 @@ static void srcu_torture_synchronize(void)
}

static void srcu_torture_call(struct rcu_head *head,
			      void (*func)(struct rcu_head *head))
			      rcu_callback_t func)
{
	call_srcu(srcu_ctlp, head, func);
}
+1 −1
Original line number Diff line number Diff line
@@ -387,7 +387,7 @@ static void srcu_flip(struct srcu_struct *sp)
 * srcu_struct structure.
 */
void call_srcu(struct srcu_struct *sp, struct rcu_head *head,
		void (*func)(struct rcu_head *head))
	       rcu_callback_t func)
{
	unsigned long flags;

Loading