hc
2023-11-06 e3e12f52b214121840b44c91de5b3e5af5d3eb84
kernel/arch/x86/crypto/cast5_avx_glue.c
....@@ -61,7 +61,7 @@
6161
6262 static int ecb_crypt(struct skcipher_request *req, bool enc)
6363 {
64
- bool fpu_enabled = false;
64
+ bool fpu_enabled;
6565 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
6666 struct cast5_ctx *ctx = crypto_skcipher_ctx(tfm);
6767 struct skcipher_walk walk;
....@@ -76,7 +76,7 @@
7676 u8 *wsrc = walk.src.virt.addr;
7777 u8 *wdst = walk.dst.virt.addr;
7878
79
- fpu_enabled = cast5_fpu_begin(fpu_enabled, &walk, nbytes);
79
+ fpu_enabled = cast5_fpu_begin(false, &walk, nbytes);
8080
8181 /* Process multi-block batch */
8282 if (nbytes >= bsize * CAST5_PARALLEL_BLOCKS) {
....@@ -105,10 +105,9 @@
105105 } while (nbytes >= bsize);
106106
107107 done:
108
+ cast5_fpu_end(fpu_enabled);
108109 err = skcipher_walk_done(&walk, nbytes);
109110 }
110
-
111
- cast5_fpu_end(fpu_enabled);
112111 return err;
113112 }
114113
....@@ -212,7 +211,7 @@
212211 {
213212 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
214213 struct cast5_ctx *ctx = crypto_skcipher_ctx(tfm);
215
- bool fpu_enabled = false;
214
+ bool fpu_enabled;
216215 struct skcipher_walk walk;
217216 unsigned int nbytes;
218217 int err;
....@@ -220,12 +219,11 @@
220219 err = skcipher_walk_virt(&walk, req, false);
221220
222221 while ((nbytes = walk.nbytes)) {
223
- fpu_enabled = cast5_fpu_begin(fpu_enabled, &walk, nbytes);
222
+ fpu_enabled = cast5_fpu_begin(false, &walk, nbytes);
224223 nbytes = __cbc_decrypt(ctx, &walk);
224
+ cast5_fpu_end(fpu_enabled);
225225 err = skcipher_walk_done(&walk, nbytes);
226226 }
227
-
228
- cast5_fpu_end(fpu_enabled);
229227 return err;
230228 }
231229
....@@ -292,7 +290,7 @@
292290 {
293291 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
294292 struct cast5_ctx *ctx = crypto_skcipher_ctx(tfm);
295
- bool fpu_enabled = false;
293
+ bool fpu_enabled;
296294 struct skcipher_walk walk;
297295 unsigned int nbytes;
298296 int err;
....@@ -300,12 +298,11 @@
300298 err = skcipher_walk_virt(&walk, req, false);
301299
302300 while ((nbytes = walk.nbytes) >= CAST5_BLOCK_SIZE) {
303
- fpu_enabled = cast5_fpu_begin(fpu_enabled, &walk, nbytes);
301
+ fpu_enabled = cast5_fpu_begin(false, &walk, nbytes);
304302 nbytes = __ctr_crypt(&walk, ctx);
303
+ cast5_fpu_end(fpu_enabled);
305304 err = skcipher_walk_done(&walk, nbytes);
306305 }
307
-
308
- cast5_fpu_end(fpu_enabled);
309306
310307 if (walk.nbytes) {
311308 ctr_crypt_final(&walk, ctx);