Linux bcachefs list
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Kent Overstreet <kent.overstreet@linux.dev>,
	linux-bcachefs@vger.kernel.org
Subject: [PATCH] bcachefs: Remove unused variable from bch2_fs_encryption_init()
Date: Wed,  2 Apr 2025 09:22:56 -0700	[thread overview]
Message-ID: <20250402162256.24122-1-ebiggers@kernel.org> (raw)

From: Eric Biggers <ebiggers@google.com>

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 <ebiggers@google.com>
---

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(-)

diff --git a/fs/bcachefs/checksum.c b/fs/bcachefs/checksum.c
index 7d1e3b908eecd..d0a34a097b809 100644
--- a/fs/bcachefs/checksum.c
+++ b/fs/bcachefs/checksum.c
@@ -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
-- 
2.49.0


             reply	other threads:[~2025-04-02 16:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-02 16:22 Eric Biggers [this message]
2025-04-02 16:27 ` [PATCH] bcachefs: Remove unused variable from bch2_fs_encryption_init() Kent Overstreet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250402162256.24122-1-ebiggers@kernel.org \
    --to=ebiggers@kernel.org \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-bcachefs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox