Skip to content

Commit aefeca1

Browse files
l1kherbertx
authored andcommitted
crypto: virtio - Drop superfluous ctx->tfm backpointer
struct virtio_crypto_[as]kcipher_ctx contains a backpointer to struct crypto_[as]kcipher which is superfluous in two ways: First, it's not used anywhere. Second, the context is embedded into struct crypto_tfm, so one could just use container_of() to get from the context to crypto_tfm and from there to crypto_[as]kcipher. Drop the superfluous backpointer. Signed-off-by: Lukas Wunner <lukas@wunner.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 17410ba commit aefeca1

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

drivers/crypto/virtio/virtio_crypto_akcipher_algs.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ struct virtio_crypto_rsa_ctx {
2626

2727
struct virtio_crypto_akcipher_ctx {
2828
struct virtio_crypto *vcrypto;
29-
struct crypto_akcipher *tfm;
3029
bool session_valid;
3130
__u64 session_id;
3231
union {
@@ -447,10 +446,6 @@ static unsigned int virtio_crypto_rsa_max_size(struct crypto_akcipher *tfm)
447446

448447
static int virtio_crypto_rsa_init_tfm(struct crypto_akcipher *tfm)
449448
{
450-
struct virtio_crypto_akcipher_ctx *ctx = akcipher_tfm_ctx(tfm);
451-
452-
ctx->tfm = tfm;
453-
454449
akcipher_set_reqsize(tfm,
455450
sizeof(struct virtio_crypto_akcipher_request));
456451

drivers/crypto/virtio/virtio_crypto_skcipher_algs.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
struct virtio_crypto_skcipher_ctx {
1919
struct virtio_crypto *vcrypto;
20-
struct crypto_skcipher *tfm;
2120

2221
struct virtio_crypto_sym_session_info enc_sess_info;
2322
struct virtio_crypto_sym_session_info dec_sess_info;
@@ -515,10 +514,7 @@ static int virtio_crypto_skcipher_decrypt(struct skcipher_request *req)
515514

516515
static int virtio_crypto_skcipher_init(struct crypto_skcipher *tfm)
517516
{
518-
struct virtio_crypto_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm);
519-
520517
crypto_skcipher_set_reqsize(tfm, sizeof(struct virtio_crypto_sym_request));
521-
ctx->tfm = tfm;
522518

523519
return 0;
524520
}

0 commit comments

Comments
 (0)