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

Configure Feed

Select the types of activity you want to include in your feed.

crypto: algapi - Add driver template support to crypto_inst_setname

Add support to crypto_inst_setname for having a driver template
name that differs from the algorithm template name.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

+14 -6
+4 -4
crypto/algapi.c
··· 923 923 } 924 924 EXPORT_SYMBOL_GPL(crypto_attr_alg_name); 925 925 926 - int crypto_inst_setname(struct crypto_instance *inst, const char *name, 927 - struct crypto_alg *alg) 926 + int __crypto_inst_setname(struct crypto_instance *inst, const char *name, 927 + const char *driver, struct crypto_alg *alg) 928 928 { 929 929 if (snprintf(inst->alg.cra_name, CRYPTO_MAX_ALG_NAME, "%s(%s)", name, 930 930 alg->cra_name) >= CRYPTO_MAX_ALG_NAME) 931 931 return -ENAMETOOLONG; 932 932 933 933 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s(%s)", 934 - name, alg->cra_driver_name) >= CRYPTO_MAX_ALG_NAME) 934 + driver, alg->cra_driver_name) >= CRYPTO_MAX_ALG_NAME) 935 935 return -ENAMETOOLONG; 936 936 937 937 return 0; 938 938 } 939 - EXPORT_SYMBOL_GPL(crypto_inst_setname); 939 + EXPORT_SYMBOL_GPL(__crypto_inst_setname); 940 940 941 941 void crypto_init_queue(struct crypto_queue *queue, unsigned int max_qlen) 942 942 {
+10 -2
include/crypto/algapi.h
··· 146 146 struct crypto_attr_type *crypto_get_attr_type(struct rtattr **tb); 147 147 int crypto_check_attr_type(struct rtattr **tb, u32 type, u32 *mask_ret); 148 148 const char *crypto_attr_alg_name(struct rtattr *rta); 149 - int crypto_inst_setname(struct crypto_instance *inst, const char *name, 150 - struct crypto_alg *alg); 149 + int __crypto_inst_setname(struct crypto_instance *inst, const char *name, 150 + const char *driver, struct crypto_alg *alg); 151 + 152 + #define crypto_inst_setname(inst, name, ...) \ 153 + CONCATENATE(crypto_inst_setname_, COUNT_ARGS(__VA_ARGS__))( \ 154 + inst, name, ##__VA_ARGS__) 155 + #define crypto_inst_setname_1(inst, name, alg) \ 156 + __crypto_inst_setname(inst, name, name, alg) 157 + #define crypto_inst_setname_2(inst, name, driver, alg) \ 158 + __crypto_inst_setname(inst, name, driver, alg) 151 159 152 160 void crypto_init_queue(struct crypto_queue *queue, unsigned int max_qlen); 153 161 int crypto_enqueue_request(struct crypto_queue *queue,