hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/arm/crypto/crct10dif-ce-glue.c
....@@ -1,11 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Accelerated CRC-T10DIF using ARM NEON and Crypto Extensions instructions
34 *
45 * Copyright (C) 2016 Linaro Ltd <ard.biesheuvel@linaro.org>
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License version 2 as
8
- * published by the Free Software Foundation.
96 */
107
118 #include <linux/crc-t10dif.h>
....@@ -15,13 +12,14 @@
1512 #include <linux/string.h>
1613
1714 #include <crypto/internal/hash.h>
15
+#include <crypto/internal/simd.h>
1816
1917 #include <asm/neon.h>
2018 #include <asm/simd.h>
2119
2220 #define CRC_T10DIF_PMULL_CHUNK_SIZE 16U
2321
24
-asmlinkage u16 crc_t10dif_pmull(u16 init_crc, const u8 buf[], u32 len);
22
+asmlinkage u16 crc_t10dif_pmull(u16 init_crc, const u8 *buf, size_t len);
2523
2624 static int crct10dif_init(struct shash_desc *desc)
2725 {
....@@ -36,7 +34,7 @@
3634 {
3735 u16 *crc = shash_desc_ctx(desc);
3836
39
- if (length >= CRC_T10DIF_PMULL_CHUNK_SIZE && may_use_simd()) {
37
+ if (length >= CRC_T10DIF_PMULL_CHUNK_SIZE && crypto_simd_usable()) {
4038 kernel_neon_begin();
4139 *crc = crc_t10dif_pmull(*crc, data, length);
4240 kernel_neon_end();