Commit cec00e6e authored by Daniel Jordan's avatar Daniel Jordan Committed by Herbert Xu

padata: inline single call of pd_setup_cpumasks()

pd_setup_cpumasks() has only one caller.  Move its contents inline to
prepare for the next cleanup.
Signed-off-by: default avatarDaniel Jordan <daniel.m.jordan@oracle.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Cc: linux-crypto@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 350ef051
...@@ -441,28 +441,6 @@ static int padata_setup_cpumasks(struct padata_instance *pinst) ...@@ -441,28 +441,6 @@ static int padata_setup_cpumasks(struct padata_instance *pinst)
return err; return err;
} }
static int pd_setup_cpumasks(struct parallel_data *pd,
const struct cpumask *pcpumask,
const struct cpumask *cbcpumask)
{
int err = -ENOMEM;
if (!alloc_cpumask_var(&pd->cpumask.pcpu, GFP_KERNEL))
goto out;
if (!alloc_cpumask_var(&pd->cpumask.cbcpu, GFP_KERNEL))
goto free_pcpu_mask;
cpumask_copy(pd->cpumask.pcpu, pcpumask);
cpumask_copy(pd->cpumask.cbcpu, cbcpumask);
return 0;
free_pcpu_mask:
free_cpumask_var(pd->cpumask.pcpu);
out:
return err;
}
static void __init padata_mt_helper(struct work_struct *w) static void __init padata_mt_helper(struct work_struct *w)
{ {
struct padata_work *pw = container_of(w, struct padata_work, pw_work); struct padata_work *pw = container_of(w, struct padata_work, pw_work);
...@@ -613,8 +591,14 @@ static struct parallel_data *padata_alloc_pd(struct padata_shell *ps) ...@@ -613,8 +591,14 @@ static struct parallel_data *padata_alloc_pd(struct padata_shell *ps)
goto err_free_pqueue; goto err_free_pqueue;
pd->ps = ps; pd->ps = ps;
if (pd_setup_cpumasks(pd, pcpumask, cbcpumask))
if (!alloc_cpumask_var(&pd->cpumask.pcpu, GFP_KERNEL))
goto err_free_squeue; goto err_free_squeue;
if (!alloc_cpumask_var(&pd->cpumask.cbcpu, GFP_KERNEL))
goto err_free_pcpu;
cpumask_copy(pd->cpumask.pcpu, pcpumask);
cpumask_copy(pd->cpumask.cbcpu, cbcpumask);
padata_init_pqueues(pd); padata_init_pqueues(pd);
padata_init_squeues(pd); padata_init_squeues(pd);
...@@ -626,6 +610,8 @@ static struct parallel_data *padata_alloc_pd(struct padata_shell *ps) ...@@ -626,6 +610,8 @@ static struct parallel_data *padata_alloc_pd(struct padata_shell *ps)
return pd; return pd;
err_free_pcpu:
free_cpumask_var(pd->cpumask.pcpu);
err_free_squeue: err_free_squeue:
free_percpu(pd->squeue); free_percpu(pd->squeue);
err_free_pqueue: err_free_pqueue:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment