mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-23 23:50:51 +07:00
padata: fold padata_alloc_possible() into padata_alloc()
There's no reason to have two interfaces when there's only one caller. Removing _possible saves text and simplifies future changes. Signed-off-by: Daniel 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: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
d69e037bcc
commit
3f257191d3
@ -27,7 +27,7 @@ padata_instance structure for overall control of how jobs are to be run::
|
|||||||
|
|
||||||
#include <linux/padata.h>
|
#include <linux/padata.h>
|
||||||
|
|
||||||
struct padata_instance *padata_alloc_possible(const char *name);
|
struct padata_instance *padata_alloc(const char *name);
|
||||||
|
|
||||||
'name' simply identifies the instance.
|
'name' simply identifies the instance.
|
||||||
|
|
||||||
|
@ -316,7 +316,7 @@ static int pcrypt_init_padata(struct padata_instance **pinst, const char *name)
|
|||||||
{
|
{
|
||||||
int ret = -ENOMEM;
|
int ret = -ENOMEM;
|
||||||
|
|
||||||
*pinst = padata_alloc_possible(name);
|
*pinst = padata_alloc(name);
|
||||||
if (!*pinst)
|
if (!*pinst)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ extern void __init padata_init(void);
|
|||||||
static inline void __init padata_init(void) {}
|
static inline void __init padata_init(void) {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern struct padata_instance *padata_alloc_possible(const char *name);
|
extern struct padata_instance *padata_alloc(const char *name);
|
||||||
extern void padata_free(struct padata_instance *pinst);
|
extern void padata_free(struct padata_instance *pinst);
|
||||||
extern struct padata_shell *padata_alloc_shell(struct padata_instance *pinst);
|
extern struct padata_shell *padata_alloc_shell(struct padata_instance *pinst);
|
||||||
extern void padata_free_shell(struct padata_shell *ps);
|
extern void padata_free_shell(struct padata_shell *ps);
|
||||||
|
@ -979,18 +979,12 @@ static struct kobj_type padata_attr_type = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* padata_alloc - allocate and initialize a padata instance and specify
|
* padata_alloc - allocate and initialize a padata instance
|
||||||
* cpumasks for serial and parallel workers.
|
|
||||||
*
|
|
||||||
* @name: used to identify the instance
|
* @name: used to identify the instance
|
||||||
* @pcpumask: cpumask that will be used for padata parallelization
|
|
||||||
* @cbcpumask: cpumask that will be used for padata serialization
|
|
||||||
*
|
*
|
||||||
* Return: new instance on success, NULL on error
|
* Return: new instance on success, NULL on error
|
||||||
*/
|
*/
|
||||||
static struct padata_instance *padata_alloc(const char *name,
|
struct padata_instance *padata_alloc(const char *name)
|
||||||
const struct cpumask *pcpumask,
|
|
||||||
const struct cpumask *cbcpumask)
|
|
||||||
{
|
{
|
||||||
struct padata_instance *pinst;
|
struct padata_instance *pinst;
|
||||||
|
|
||||||
@ -1016,14 +1010,11 @@ static struct padata_instance *padata_alloc(const char *name,
|
|||||||
free_cpumask_var(pinst->cpumask.pcpu);
|
free_cpumask_var(pinst->cpumask.pcpu);
|
||||||
goto err_free_serial_wq;
|
goto err_free_serial_wq;
|
||||||
}
|
}
|
||||||
if (!padata_validate_cpumask(pinst, pcpumask) ||
|
|
||||||
!padata_validate_cpumask(pinst, cbcpumask))
|
|
||||||
goto err_free_masks;
|
|
||||||
|
|
||||||
INIT_LIST_HEAD(&pinst->pslist);
|
INIT_LIST_HEAD(&pinst->pslist);
|
||||||
|
|
||||||
cpumask_copy(pinst->cpumask.pcpu, pcpumask);
|
cpumask_copy(pinst->cpumask.pcpu, cpu_possible_mask);
|
||||||
cpumask_copy(pinst->cpumask.cbcpu, cbcpumask);
|
cpumask_copy(pinst->cpumask.cbcpu, cpu_possible_mask);
|
||||||
|
|
||||||
if (padata_setup_cpumasks(pinst))
|
if (padata_setup_cpumasks(pinst))
|
||||||
goto err_free_masks;
|
goto err_free_masks;
|
||||||
@ -1057,21 +1048,7 @@ static struct padata_instance *padata_alloc(const char *name,
|
|||||||
err:
|
err:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL(padata_alloc);
|
||||||
/**
|
|
||||||
* padata_alloc_possible - Allocate and initialize padata instance.
|
|
||||||
* Use the cpu_possible_mask for serial and
|
|
||||||
* parallel workers.
|
|
||||||
*
|
|
||||||
* @name: used to identify the instance
|
|
||||||
*
|
|
||||||
* Return: new instance on success, NULL on error
|
|
||||||
*/
|
|
||||||
struct padata_instance *padata_alloc_possible(const char *name)
|
|
||||||
{
|
|
||||||
return padata_alloc(name, cpu_possible_mask, cpu_possible_mask);
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(padata_alloc_possible);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* padata_free - free a padata instance
|
* padata_free - free a padata instance
|
||||||
|
Loading…
Reference in New Issue
Block a user