Skip to content

Commit

Permalink
[PATCH] EDAC: edac_mc_add_mc fix [1/2]
Browse files Browse the repository at this point in the history
This is part 1 of a 2-part patch set.  The code changes are split into
two parts to make the patches more readable.

Move complete_mc_list_del() and del_mc_from_global_list() so we can
call del_mc_from_global_list() from edac_mc_add_mc() without forward
declarations.  Perhaps using forward declarations would be better?
I'm doing things this way because the rest of the code is missing
them.

Signed-off-by: David S. Peterson <dsp@llnl.gov>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Dave Peterson authored and Linus Torvalds committed Mar 26, 2006
1 parent 749ede5 commit a1d03fc
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions drivers/edac/edac_mc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1451,6 +1451,24 @@ static int add_mc_to_global_list (struct mem_ctl_info *mci)
}


static void complete_mc_list_del (struct rcu_head *head)
{
struct mem_ctl_info *mci;

mci = container_of(head, struct mem_ctl_info, rcu);
INIT_LIST_HEAD(&mci->link);
complete(&mci->complete);
}


static void del_mc_from_global_list (struct mem_ctl_info *mci)
{
list_del_rcu(&mci->link);
init_completion(&mci->complete);
call_rcu(&mci->rcu, complete_mc_list_del);
wait_for_completion(&mci->complete);
}


EXPORT_SYMBOL(edac_mc_add_mc);

Expand Down Expand Up @@ -1511,24 +1529,6 @@ int edac_mc_add_mc(struct mem_ctl_info *mci)
}



static void complete_mc_list_del (struct rcu_head *head)
{
struct mem_ctl_info *mci;

mci = container_of(head, struct mem_ctl_info, rcu);
INIT_LIST_HEAD(&mci->link);
complete(&mci->complete);
}

static void del_mc_from_global_list (struct mem_ctl_info *mci)
{
list_del_rcu(&mci->link);
init_completion(&mci->complete);
call_rcu(&mci->rcu, complete_mc_list_del);
wait_for_completion(&mci->complete);
}

EXPORT_SYMBOL(edac_mc_del_mc);

/**
Expand Down

0 comments on commit a1d03fc

Please sign in to comment.