Skip to content

Commit 3f25719

Browse files
danieljordan10herbertx
authored andcommitted
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>
1 parent d69e037 commit 3f25719

4 files changed

Lines changed: 8 additions & 31 deletions

File tree

‎Documentation/core-api/padata.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ padata_instance structure for overall control of how jobs are to be run::
2727

2828
#include <linux/padata.h>
2929

30-
struct padata_instance *padata_alloc_possible(const char *name);
30+
struct padata_instance *padata_alloc(const char *name);
3131

3232
'name' simply identifies the instance.
3333

‎crypto/pcrypt.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ static int pcrypt_init_padata(struct padata_instance **pinst, const char *name)
316316
{
317317
int ret = -ENOMEM;
318318

319-
*pinst = padata_alloc_possible(name);
319+
*pinst = padata_alloc(name);
320320
if (!*pinst)
321321
return ret;
322322

‎include/linux/padata.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ extern void __init padata_init(void);
192192
static inline void __init padata_init(void) {}
193193
#endif
194194

195-
extern struct padata_instance *padata_alloc_possible(const char *name);
195+
extern struct padata_instance *padata_alloc(const char *name);
196196
extern void padata_free(struct padata_instance *pinst);
197197
extern struct padata_shell *padata_alloc_shell(struct padata_instance *pinst);
198198
extern void padata_free_shell(struct padata_shell *ps);

‎kernel/padata.c‎

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -979,18 +979,12 @@ static struct kobj_type padata_attr_type = {
979979
};
980980

981981
/**
982-
* padata_alloc - allocate and initialize a padata instance and specify
983-
* cpumasks for serial and parallel workers.
984-
*
982+
* padata_alloc - allocate and initialize a padata instance
985983
* @name: used to identify the instance
986-
* @pcpumask: cpumask that will be used for padata parallelization
987-
* @cbcpumask: cpumask that will be used for padata serialization
988984
*
989985
* Return: new instance on success, NULL on error
990986
*/
991-
static struct padata_instance *padata_alloc(const char *name,
992-
const struct cpumask *pcpumask,
993-
const struct cpumask *cbcpumask)
987+
struct padata_instance *padata_alloc(const char *name)
994988
{
995989
struct padata_instance *pinst;
996990

@@ -1016,14 +1010,11 @@ static struct padata_instance *padata_alloc(const char *name,
10161010
free_cpumask_var(pinst->cpumask.pcpu);
10171011
goto err_free_serial_wq;
10181012
}
1019-
if (!padata_validate_cpumask(pinst, pcpumask) ||
1020-
!padata_validate_cpumask(pinst, cbcpumask))
1021-
goto err_free_masks;
10221013

10231014
INIT_LIST_HEAD(&pinst->pslist);
10241015

1025-
cpumask_copy(pinst->cpumask.pcpu, pcpumask);
1026-
cpumask_copy(pinst->cpumask.cbcpu, cbcpumask);
1016+
cpumask_copy(pinst->cpumask.pcpu, cpu_possible_mask);
1017+
cpumask_copy(pinst->cpumask.cbcpu, cpu_possible_mask);
10271018

10281019
if (padata_setup_cpumasks(pinst))
10291020
goto err_free_masks;
@@ -1057,21 +1048,7 @@ static struct padata_instance *padata_alloc(const char *name,
10571048
err:
10581049
return NULL;
10591050
}
1060-
1061-
/**
1062-
* padata_alloc_possible - Allocate and initialize padata instance.
1063-
* Use the cpu_possible_mask for serial and
1064-
* parallel workers.
1065-
*
1066-
* @name: used to identify the instance
1067-
*
1068-
* Return: new instance on success, NULL on error
1069-
*/
1070-
struct padata_instance *padata_alloc_possible(const char *name)
1071-
{
1072-
return padata_alloc(name, cpu_possible_mask, cpu_possible_mask);
1073-
}
1074-
EXPORT_SYMBOL(padata_alloc_possible);
1051+
EXPORT_SYMBOL(padata_alloc);
10751052

10761053
/**
10771054
* padata_free - free a padata instance

0 commit comments

Comments
 (0)