Skip to content

Commit

Permalink
pid: fix the do_each_pid_task() macro
Browse files Browse the repository at this point in the history
Impact: macro side-effects fix

This patch adds parenthesis around 'pid' in the do_each_pid_task
macro to allow callers to pass in more complex parameters.

e.g.  do_each_pid_task(*pid, type, task)

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Steven Rostedt authored and Ingo Molnar committed Dec 4, 2008
1 parent 804a685 commit 5ef6476
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/linux/pid.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ pid_t pid_vnr(struct pid *pid);
#define do_each_pid_task(pid, type, task) \
do { \
struct hlist_node *pos___; \
if (pid != NULL) \
if ((pid) != NULL) \
hlist_for_each_entry_rcu((task), pos___, \
&pid->tasks[type], pids[type].node) {
&(pid)->tasks[type], pids[type].node) {

/*
* Both old and new leaders may be attached to
Expand Down

0 comments on commit 5ef6476

Please sign in to comment.