.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Cryptographic API. |
---|
3 | 4 | * |
---|
.. | .. |
---|
14 | 15 | * pages = {}, |
---|
15 | 16 | * month = {June}, |
---|
16 | 17 | *} |
---|
17 | | - * Used by the iSCSI driver, possibly others, and derived from the |
---|
| 18 | + * Used by the iSCSI driver, possibly others, and derived from |
---|
18 | 19 | * the iscsi-crc.c module of the linux-iscsi driver at |
---|
19 | 20 | * http://linux-iscsi.sourceforge.net. |
---|
20 | 21 | * |
---|
.. | .. |
---|
27 | 28 | * |
---|
28 | 29 | * Copyright (c) 2004 Cisco Systems, Inc. |
---|
29 | 30 | * 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 | | - * |
---|
36 | 31 | */ |
---|
37 | 32 | |
---|
38 | 33 | #include <asm/unaligned.h> |
---|
.. | .. |
---|
55 | 50 | }; |
---|
56 | 51 | |
---|
57 | 52 | /* |
---|
58 | | - * Steps through buffer one byte at at time, calculates reflected |
---|
| 53 | + * Steps through buffer one byte at a time, calculates reflected |
---|
59 | 54 | * crc using table. |
---|
60 | 55 | */ |
---|
61 | 56 | |
---|
.. | .. |
---|
79 | 74 | { |
---|
80 | 75 | struct chksum_ctx *mctx = crypto_shash_ctx(tfm); |
---|
81 | 76 | |
---|
82 | | - if (keylen != sizeof(mctx->key)) { |
---|
83 | | - crypto_shash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); |
---|
| 77 | + if (keylen != sizeof(mctx->key)) |
---|
84 | 78 | return -EINVAL; |
---|
85 | | - } |
---|
86 | 79 | mctx->key = get_unaligned_le32(key); |
---|
87 | 80 | return 0; |
---|
88 | 81 | } |
---|
.. | .. |
---|
165 | 158 | crypto_unregister_shash(&alg); |
---|
166 | 159 | } |
---|
167 | 160 | |
---|
168 | | -module_init(crc32c_mod_init); |
---|
| 161 | +subsys_initcall(crc32c_mod_init); |
---|
169 | 162 | module_exit(crc32c_mod_fini); |
---|
170 | 163 | |
---|
171 | 164 | MODULE_AUTHOR("Clay Haapala <chaapala@cisco.com>"); |
---|