From: Dave Peterson 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 Cc: Cc: Alan Cox Signed-off-by: Andrew Morton --- drivers/edac/edac_mc.c | 36 ++++++++++++++++++------------------ 1 files changed, 18 insertions(+), 18 deletions(-) diff -puN drivers/edac/edac_mc.c~edac-edac_mc_add_mc-fix-1 drivers/edac/edac_mc.c --- devel/drivers/edac/edac_mc.c~edac-edac_mc_add_mc-fix-1 2006-03-11 02:50:30.000000000 -0800 +++ devel-akpm/drivers/edac/edac_mc.c 2006-03-11 02:50:30.000000000 -0800 @@ -1411,6 +1411,24 @@ static int add_mc_to_global_list (struct } +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); @@ -1472,24 +1490,6 @@ finish: } - -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); /** _