bcachefs: Remove unused variable from bch2_fs_encryption_init()
PATCH 1/1 bcachefs: Remove unused variable from bch2_fs_encryption_init()
From: Eric Biggers <[email protected]>
The 'key' local variable is no longer used, now that the key is being written directly to the struct bch_fs.
Signed-off-by Eric Biggers <[email protected]>
---
Please feel free to fold this into
"bcachefs: use library APIs for ChaCha20 and Poly1305".
fs/bcachefs/checksum.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
fs/bcachefs/checksum.c +4 -7
@@ -682,20 +682,17 @@ void bch2_fs_encryption_exit(struct bch_fs *c) }int bch2_fs_encryption_init (struct bch_fs *c) {struct bch_sb_field_crypt *crypt; -struct bch_key key; -int ret =0 ; +int ret; crypt =bch2_sb_field_get (c->disk_sb.sb, crypt);if (!crypt) - goto out; +return 0 ; ret =bch2_decrypt_sb_key (c, crypt, &c->chacha20_key);if (ret) - goto out; +return ret; c->chacha20_key_set = true; -out: -memzero_explicit (&key,sizeof (key)); -return ret; +return 0 ; }
base-commit: 04c4768d24f70d457ff49681ef726d5d23c089a5
Signature · 1 line
2.49.0
Kent Overstreet
AppliedQuoted 6 lines · Eric Biggers
From: Eric Biggers <[email protected]>
The 'key' local variable is no longer used, now that the key is being written directly to the struct
bch_fs.Signed-off-by Eric Biggers <[email protected]>
Applied
Quoted 42 lines
---
Please feel free to fold this into
"bcachefs: use library APIs for ChaCha20 and Poly1305".fs/bcachefs/checksum.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)fs/bcachefs/checksum.c +4
-7@@ -682,20 +682,17 @@ void bch2_fs_encryption_exit(struct bch_fs *c) }int bch2_fs_encryption_init (struct bch_fs *c) {struct bch_sb_field_crypt *crypt; -struct bch_key key; -int ret =0 ; +int ret; crypt =bch2_sb_field_get (c->disk_sb.sb, crypt);if (!crypt) - goto out; +return 0 ; ret =bch2_decrypt_sb_key (c, crypt, &c->chacha20_key);if (ret) - goto out; +return ret; c->chacha20_key_set = true; -out: -memzero_explicit (&key,sizeof (key)); -return ret; +return 0 ; }base-commit:
04c4768d24f70d457ff49681ef726d5d23c089a5Signature · 1 line
2.49.0