summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2025-04-25 11:05:29 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2025-04-28 19:45:26 +0800
commitb75fa20c127eb736b0ac9b30be051f526a2316a9 (patch)
treead56c6678c110145fac067d1e6628d51d58ce659 /include/linux
parente3b49657228c114099b4591821465dc6f9884c61 (diff)
crypto: api - Add crypto_stack_request_init and initialise flags fully
Add a helper to initialise crypto stack requests and use it for ahash and acomp. Make sure that the flags field is initialised fully in the helper to silence false-positive warnings from the compiler. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202504250751.mdy28Ibr-lkp@intel.com/ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/crypto.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index fe75320ff9a3..b8d875b11193 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -514,5 +514,13 @@ static inline void crypto_request_set_tfm(struct crypto_async_request *req,
struct crypto_async_request *crypto_request_clone(
struct crypto_async_request *req, size_t total, gfp_t gfp);
+static inline void crypto_stack_request_init(struct crypto_async_request *req,
+ struct crypto_tfm *tfm)
+{
+ req->flags = 0;
+ crypto_request_set_tfm(req, tfm);
+ req->flags |= CRYPTO_TFM_REQ_ON_STACK;
+}
+
#endif /* _LINUX_CRYPTO_H */