hc
2024-10-09 05e59e5fb0064c97a1c10921ecd549f2d4a58565
kernel/crypto/crc32c_generic.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Cryptographic API.
34 *
....@@ -14,7 +15,7 @@
1415 * pages = {},
1516 * month = {June},
1617 *}
17
- * Used by the iSCSI driver, possibly others, and derived from the
18
+ * Used by the iSCSI driver, possibly others, and derived from
1819 * the iscsi-crc.c module of the linux-iscsi driver at
1920 * http://linux-iscsi.sourceforge.net.
2021 *
....@@ -27,12 +28,6 @@
2728 *
2829 * Copyright (c) 2004 Cisco Systems, Inc.
2930 * Copyright (c) 2008 Herbert Xu <herbert@gondor.apana.org.au>
30
- *
31
- * This program is free software; you can redistribute it and/or modify it
32
- * under the terms of the GNU General Public License as published by the Free
33
- * Software Foundation; either version 2 of the License, or (at your option)
34
- * any later version.
35
- *
3631 */
3732
3833 #include <asm/unaligned.h>
....@@ -55,7 +50,7 @@
5550 };
5651
5752 /*
58
- * Steps through buffer one byte at at time, calculates reflected
53
+ * Steps through buffer one byte at a time, calculates reflected
5954 * crc using table.
6055 */
6156
....@@ -79,10 +74,8 @@
7974 {
8075 struct chksum_ctx *mctx = crypto_shash_ctx(tfm);
8176
82
- if (keylen != sizeof(mctx->key)) {
83
- crypto_shash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
77
+ if (keylen != sizeof(mctx->key))
8478 return -EINVAL;
85
- }
8679 mctx->key = get_unaligned_le32(key);
8780 return 0;
8881 }
....@@ -165,7 +158,7 @@
165158 crypto_unregister_shash(&alg);
166159 }
167160
168
-module_init(crc32c_mod_init);
161
+subsys_initcall(crc32c_mod_init);
169162 module_exit(crc32c_mod_fini);
170163
171164 MODULE_AUTHOR("Clay Haapala <chaapala@cisco.com>");