forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/arch/x86/crypto/crc32-pclmul_glue.c
....@@ -32,10 +32,11 @@
3232 #include <linux/kernel.h>
3333 #include <linux/crc32.h>
3434 #include <crypto/internal/hash.h>
35
+#include <crypto/internal/simd.h>
3536
3637 #include <asm/cpufeatures.h>
3738 #include <asm/cpu_device_id.h>
38
-#include <asm/fpu/api.h>
39
+#include <asm/simd.h>
3940
4041 #define CHKSUM_BLOCK_SIZE 1
4142 #define CHKSUM_DIGEST_SIZE 4
....@@ -54,7 +55,7 @@
5455 unsigned int iremainder;
5556 unsigned int prealign;
5657
57
- if (len < PCLMUL_MIN_LEN + SCALE_F_MASK || !irq_fpu_usable())
58
+ if (len < PCLMUL_MIN_LEN + SCALE_F_MASK || !crypto_simd_usable())
5859 return crc32_le(crc, p, len);
5960
6061 if ((long)p & SCALE_F_MASK) {
....@@ -93,10 +94,8 @@
9394 {
9495 u32 *mctx = crypto_shash_ctx(hash);
9596
96
- if (keylen != sizeof(u32)) {
97
- crypto_shash_set_flags(hash, CRYPTO_TFM_RES_BAD_KEY_LEN);
97
+ if (keylen != sizeof(u32))
9898 return -EINVAL;
99
- }
10099 *mctx = le32_to_cpup((__le32 *)key);
101100 return 0;
102101 }
....@@ -171,7 +170,7 @@
171170 };
172171
173172 static const struct x86_cpu_id crc32pclmul_cpu_id[] = {
174
- X86_FEATURE_MATCH(X86_FEATURE_PCLMULQDQ),
173
+ X86_MATCH_FEATURE(X86_FEATURE_PCLMULQDQ, NULL),
175174 {}
176175 };
177176 MODULE_DEVICE_TABLE(x86cpu, crc32pclmul_cpu_id);