hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/crypto/acompress.c
....@@ -1,15 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Asynchronous Compression operations
34 *
45 * Copyright (c) 2016, Intel Corporation
56 * Authors: Weigang Li <weigang.li@intel.com>
67 * Giovanni Cabiddu <giovanni.cabiddu@intel.com>
7
- *
8
- * This program is free software; you can redistribute it and/or modify it
9
- * under the terms of the GNU General Public License as published by the Free
10
- * Software Foundation; either version 2 of the License, or (at your option)
11
- * any later version.
12
- *
138 */
149 #include <linux/errno.h>
1510 #include <linux/kernel.h>
....@@ -33,15 +28,11 @@
3328 {
3429 struct crypto_report_acomp racomp;
3530
36
- strncpy(racomp.type, "acomp", sizeof(racomp.type));
31
+ memset(&racomp, 0, sizeof(racomp));
3732
38
- if (nla_put(skb, CRYPTOCFGA_REPORT_ACOMP,
39
- sizeof(struct crypto_report_acomp), &racomp))
40
- goto nla_put_failure;
41
- return 0;
33
+ strscpy(racomp.type, "acomp", sizeof(racomp.type));
4234
43
-nla_put_failure:
44
- return -EMSGSIZE;
35
+ return nla_put(skb, CRYPTOCFGA_REPORT_ACOMP, sizeof(racomp), &racomp);
4536 }
4637 #else
4738 static int crypto_acomp_report(struct sk_buff *skb, struct crypto_alg *alg)
....@@ -118,6 +109,14 @@
118109 }
119110 EXPORT_SYMBOL_GPL(crypto_alloc_acomp);
120111
112
+struct crypto_acomp *crypto_alloc_acomp_node(const char *alg_name, u32 type,
113
+ u32 mask, int node)
114
+{
115
+ return crypto_alloc_tfm_node(alg_name, &crypto_acomp_type, type, mask,
116
+ node);
117
+}
118
+EXPORT_SYMBOL_GPL(crypto_alloc_acomp_node);
119
+
121120 struct acomp_req *acomp_request_alloc(struct crypto_acomp *acomp)
122121 {
123122 struct crypto_tfm *tfm = crypto_acomp_tfm(acomp);
....@@ -160,9 +159,9 @@
160159 }
161160 EXPORT_SYMBOL_GPL(crypto_register_acomp);
162161
163
-int crypto_unregister_acomp(struct acomp_alg *alg)
162
+void crypto_unregister_acomp(struct acomp_alg *alg)
164163 {
165
- return crypto_unregister_alg(&alg->base);
164
+ crypto_unregister_alg(&alg->base);
166165 }
167166 EXPORT_SYMBOL_GPL(crypto_unregister_acomp);
168167