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: api - Add helpers to manage request flags

Add helpers so that the ON_STACK request flag management is not
duplicated all over the place.

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

+29
+5
include/crypto/algapi.h
··· 272 272 return tfm->__crt_alg->cra_flags & CRYPTO_ALG_REQ_CHAIN; 273 273 } 274 274 275 + static inline u32 crypto_request_flags(struct crypto_async_request *req) 276 + { 277 + return req->flags & ~CRYPTO_TFM_REQ_ON_STACK; 278 + } 279 + 275 280 #endif /* _CRYPTO_ALGAPI_H */
+24
include/linux/crypto.h
··· 476 476 return tfm->__crt_alg->cra_flags & CRYPTO_ALG_ASYNC; 477 477 } 478 478 479 + static inline bool crypto_req_on_stack(struct crypto_async_request *req) 480 + { 481 + return req->flags & CRYPTO_TFM_REQ_ON_STACK; 482 + } 483 + 484 + static inline void crypto_request_set_callback( 485 + struct crypto_async_request *req, u32 flags, 486 + crypto_completion_t compl, void *data) 487 + { 488 + u32 keep = CRYPTO_TFM_REQ_ON_STACK; 489 + 490 + req->complete = compl; 491 + req->data = data; 492 + req->flags &= keep; 493 + req->flags |= flags & ~keep; 494 + } 495 + 496 + static inline void crypto_request_set_tfm(struct crypto_async_request *req, 497 + struct crypto_tfm *tfm) 498 + { 499 + req->tfm = tfm; 500 + req->flags &= ~CRYPTO_TFM_REQ_ON_STACK; 501 + } 502 + 479 503 #endif /* _LINUX_CRYPTO_H */ 480 504