]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
libceph: Remove unused ceph_crypto_key_encode
authorDr. David Alan Gilbert <linux@treblig.org>
Sun, 6 Oct 2024 01:19:55 +0000 (02:19 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 18 Nov 2024 16:34:35 +0000 (17:34 +0100)
ceph_crypto_key_encode() was added in 2010's commit
8b6e4f2d8b21 ("ceph: aes crypto and base64 encode/decode helpers")

but has remained unused (the decode is used).

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
net/ceph/crypto.c
net/ceph/crypto.h

index 051d22c0e4ad4bbbc41746f9b986f150d8e6aba8..01b2ce1e8fc06eec7cfdc2aa9c6cde5398a40fc3 100644 (file)
@@ -74,18 +74,6 @@ int ceph_crypto_key_clone(struct ceph_crypto_key *dst,
        return set_secret(dst, src->key);
 }
 
-int ceph_crypto_key_encode(struct ceph_crypto_key *key, void **p, void *end)
-{
-       if (*p + sizeof(u16) + sizeof(key->created) +
-           sizeof(u16) + key->len > end)
-               return -ERANGE;
-       ceph_encode_16(p, key->type);
-       ceph_encode_copy(p, &key->created, sizeof(key->created));
-       ceph_encode_16(p, key->len);
-       ceph_encode_copy(p, key->key, key->len);
-       return 0;
-}
-
 int ceph_crypto_key_decode(struct ceph_crypto_key *key, void **p, void *end)
 {
        int ret;
index 13bd526349fa1b63b71f84fb4ab1076fc1d2a7f2..23de29fc613cf1909096c222cdda1d3e10ad2d0a 100644 (file)
@@ -21,7 +21,6 @@ struct ceph_crypto_key {
 
 int ceph_crypto_key_clone(struct ceph_crypto_key *dst,
                          const struct ceph_crypto_key *src);
-int ceph_crypto_key_encode(struct ceph_crypto_key *key, void **p, void *end);
 int ceph_crypto_key_decode(struct ceph_crypto_key *key, void **p, void *end);
 int ceph_crypto_key_unarmor(struct ceph_crypto_key *key, const char *in);
 void ceph_crypto_key_destroy(struct ceph_crypto_key *key);