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

Commit 0500e9b3 authored by Steffen Klassert's avatar Steffen Klassert Committed by Herbert Xu
Browse files

padata: Remove padata_get_cpumask



A function that copies the padata cpumasks to a user buffer
is a bit error prone. The cpumask can change any time so we
can't be sure to have the right cpumask when using this function.
A user who is interested in the padata cpumasks should register
to the padata cpumask notifier chain instead. Users of
padata_get_cpumask are already updated, so we can remove it.

Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent d3f64e46
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -176,8 +176,6 @@ extern void padata_free(struct padata_instance *pinst);
extern int padata_do_parallel(struct padata_instance *pinst,
			      struct padata_priv *padata, int cb_cpu);
extern void padata_do_serial(struct padata_priv *padata);
extern int padata_get_cpumask(struct padata_instance *pinst,
			      int cpumask_type, struct cpumask *out_mask);
extern int padata_set_cpumask(struct padata_instance *pinst, int cpumask_type,
			      cpumask_var_t cpumask);
extern int padata_set_cpumasks(struct padata_instance *pinst,
+0 −35
Original line number Diff line number Diff line
@@ -589,41 +589,6 @@ static bool padata_validate_cpumask(struct padata_instance *pinst,
	return true;
}

/**
 * padata_get_cpumask: Fetch serial or parallel cpumask from the
 *                     given padata instance and copy it to @out_mask
 *
 * @pinst: A pointer to padata instance
 * @cpumask_type: Specifies which cpumask will be copied.
 *                Possible values are PADATA_CPU_SERIAL *or* PADATA_CPU_PARALLEL
 *                corresponding to serial and parallel cpumask respectively.
 * @out_mask: A pointer to cpumask structure where selected
 *            cpumask will be copied.
 */
int padata_get_cpumask(struct padata_instance *pinst,
		       int cpumask_type, struct cpumask *out_mask)
{
	struct parallel_data *pd;
	int ret = 0;

	rcu_read_lock_bh();
	pd = rcu_dereference(pinst->pd);
	switch (cpumask_type) {
	case PADATA_CPU_SERIAL:
		cpumask_copy(out_mask, pd->cpumask.cbcpu);
		break;
	case PADATA_CPU_PARALLEL:
		cpumask_copy(out_mask, pd->cpumask.pcpu);
		break;
	default:
		ret = -EINVAL;
	}

	rcu_read_unlock_bh();
	return ret;
}
EXPORT_SYMBOL(padata_get_cpumask);

static int __padata_set_cpumasks(struct padata_instance *pinst,
				 cpumask_var_t pcpumask,
				 cpumask_var_t cbcpumask)