Revert "tty: hvc: Fix data abort due to race in hvc_open"
[linux/fpc-iii.git] / include / crypto / internal / acompress.h
blobcf478681b53e7e5a1303d01fcf36b57410e175c5
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 * Asynchronous Compression operations
5 * Copyright (c) 2016, Intel Corporation
6 * Authors: Weigang Li <weigang.li@intel.com>
7 * Giovanni Cabiddu <giovanni.cabiddu@intel.com>
8 */
9 #ifndef _CRYPTO_ACOMP_INT_H
10 #define _CRYPTO_ACOMP_INT_H
11 #include <crypto/acompress.h>
14 * Transform internal helpers.
16 static inline void *acomp_request_ctx(struct acomp_req *req)
18 return req->__ctx;
21 static inline void *acomp_tfm_ctx(struct crypto_acomp *tfm)
23 return tfm->base.__crt_ctx;
26 static inline void acomp_request_complete(struct acomp_req *req,
27 int err)
29 req->base.complete(&req->base, err);
32 static inline const char *acomp_alg_name(struct crypto_acomp *tfm)
34 return crypto_acomp_tfm(tfm)->__crt_alg->cra_name;
37 static inline struct acomp_req *__acomp_request_alloc(struct crypto_acomp *tfm)
39 struct acomp_req *req;
41 req = kzalloc(sizeof(*req) + crypto_acomp_reqsize(tfm), GFP_KERNEL);
42 if (likely(req))
43 acomp_request_set_tfm(req, tfm);
44 return req;
47 static inline void __acomp_request_free(struct acomp_req *req)
49 kzfree(req);
52 /**
53 * crypto_register_acomp() -- Register asynchronous compression algorithm
55 * Function registers an implementation of an asynchronous
56 * compression algorithm
58 * @alg: algorithm definition
60 * Return: zero on success; error code in case of error
62 int crypto_register_acomp(struct acomp_alg *alg);
64 /**
65 * crypto_unregister_acomp() -- Unregister asynchronous compression algorithm
67 * Function unregisters an implementation of an asynchronous
68 * compression algorithm
70 * @alg: algorithm definition
72 void crypto_unregister_acomp(struct acomp_alg *alg);
74 int crypto_register_acomps(struct acomp_alg *algs, int count);
75 void crypto_unregister_acomps(struct acomp_alg *algs, int count);
77 #endif