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: skcipher - Set tfm in SYNC_SKCIPHER_REQUEST_ON_STACK

Set the request tfm directly in SYNC_SKCIPHER_REQUEST_ON_STACK since
the tfm is already available.

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

+13 -6
+13 -6
include/crypto/skcipher.h
··· 214 214 215 215 #define MAX_SYNC_SKCIPHER_REQSIZE 384 216 216 /* 217 - * This performs a type-check against the "tfm" argument to make sure 217 + * This performs a type-check against the "_tfm" argument to make sure 218 218 * all users have the correct skcipher tfm for doing on-stack requests. 219 219 */ 220 - #define SYNC_SKCIPHER_REQUEST_ON_STACK(name, tfm) \ 220 + #define SYNC_SKCIPHER_REQUEST_ON_STACK(name, _tfm) \ 221 221 char __##name##_desc[sizeof(struct skcipher_request) + \ 222 - MAX_SYNC_SKCIPHER_REQSIZE + \ 223 - (!(sizeof((struct crypto_sync_skcipher *)1 == \ 224 - (typeof(tfm))1))) \ 222 + MAX_SYNC_SKCIPHER_REQSIZE \ 225 223 ] CRYPTO_MINALIGN_ATTR; \ 226 - struct skcipher_request *name = (void *)__##name##_desc 224 + struct skcipher_request *name = \ 225 + (((struct skcipher_request *)__##name##_desc)->base.tfm = \ 226 + crypto_sync_skcipher_tfm((_tfm)), \ 227 + (void *)__##name##_desc) 227 228 228 229 /** 229 230 * DOC: Symmetric Key Cipher API ··· 310 309 struct crypto_lskcipher *tfm) 311 310 { 312 311 return &tfm->base; 312 + } 313 + 314 + static inline struct crypto_tfm *crypto_sync_skcipher_tfm( 315 + struct crypto_sync_skcipher *tfm) 316 + { 317 + return crypto_skcipher_tfm(&tfm->base); 313 318 } 314 319 315 320 /**