Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Daniel Jordan and committed by
Herbert Xu
3f257191 d69e037b

+8 -31
+1 -1
Documentation/core-api/padata.rst
··· 27 27 28 28 #include <linux/padata.h> 29 29 30 - struct padata_instance *padata_alloc_possible(const char *name); 30 + struct padata_instance *padata_alloc(const char *name); 31 31 32 32 'name' simply identifies the instance. 33 33
+1 -1
crypto/pcrypt.c
··· 316 316 { 317 317 int ret = -ENOMEM; 318 318 319 - *pinst = padata_alloc_possible(name); 319 + *pinst = padata_alloc(name); 320 320 if (!*pinst) 321 321 return ret; 322 322
+1 -1
include/linux/padata.h
··· 192 192 static inline void __init padata_init(void) {} 193 193 #endif 194 194 195 - extern struct padata_instance *padata_alloc_possible(const char *name); 195 + extern struct padata_instance *padata_alloc(const char *name); 196 196 extern void padata_free(struct padata_instance *pinst); 197 197 extern struct padata_shell *padata_alloc_shell(struct padata_instance *pinst); 198 198 extern void padata_free_shell(struct padata_shell *ps);
+5 -28
kernel/padata.c
··· 979 979 }; 980 980 981 981 /** 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 985 983 * @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 988 984 * 989 985 * Return: new instance on success, NULL on error 990 986 */ 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) 994 988 { 995 989 struct padata_instance *pinst; 996 990 ··· 1010 1016 free_cpumask_var(pinst->cpumask.pcpu); 1011 1017 goto err_free_serial_wq; 1012 1018 } 1013 - if (!padata_validate_cpumask(pinst, pcpumask) || 1014 - !padata_validate_cpumask(pinst, cbcpumask)) 1015 - goto err_free_masks; 1016 1019 1017 1020 INIT_LIST_HEAD(&pinst->pslist); 1018 1021 1019 - cpumask_copy(pinst->cpumask.pcpu, pcpumask); 1020 - cpumask_copy(pinst->cpumask.cbcpu, cbcpumask); 1022 + cpumask_copy(pinst->cpumask.pcpu, cpu_possible_mask); 1023 + cpumask_copy(pinst->cpumask.cbcpu, cpu_possible_mask); 1021 1024 1022 1025 if (padata_setup_cpumasks(pinst)) 1023 1026 goto err_free_masks; ··· 1048 1057 err: 1049 1058 return NULL; 1050 1059 } 1051 - 1052 - /** 1053 - * padata_alloc_possible - Allocate and initialize padata instance. 1054 - * Use the cpu_possible_mask for serial and 1055 - * parallel workers. 1056 - * 1057 - * @name: used to identify the instance 1058 - * 1059 - * Return: new instance on success, NULL on error 1060 - */ 1061 - struct padata_instance *padata_alloc_possible(const char *name) 1062 - { 1063 - return padata_alloc(name, cpu_possible_mask, cpu_possible_mask); 1064 - } 1065 - EXPORT_SYMBOL(padata_alloc_possible); 1060 + EXPORT_SYMBOL(padata_alloc); 1066 1061 1067 1062 /** 1068 1063 * padata_free - free a padata instance