kernel_samsung_a53x/drivers/crypto/virtio
zhenwei pi 5f69a5f8bf virtio-crypto: change code style
[ Upstream commit 6fd763d155860eb7ea3a93c8b3bf926940ffa3fb ]

Use temporary variable to make code easy to read and maintain.
	/* Pad cipher's parameters */
        vcrypto->ctrl.u.sym_create_session.op_type =
                cpu_to_le32(VIRTIO_CRYPTO_SYM_OP_CIPHER);
        vcrypto->ctrl.u.sym_create_session.u.cipher.para.algo =
                vcrypto->ctrl.header.algo;
        vcrypto->ctrl.u.sym_create_session.u.cipher.para.keylen =
                cpu_to_le32(keylen);
        vcrypto->ctrl.u.sym_create_session.u.cipher.para.op =
                cpu_to_le32(op);
-->
	sym_create_session = &ctrl->u.sym_create_session;
	sym_create_session->op_type = cpu_to_le32(VIRTIO_CRYPTO_SYM_OP_CIPHER);
	sym_create_session->u.cipher.para.algo = ctrl->header.algo;
	sym_create_session->u.cipher.para.keylen = cpu_to_le32(keylen);
	sym_create_session->u.cipher.para.op = cpu_to_le32(op);

The new style shows more obviously:
- the variable we want to operate.
- an assignment statement in a single line.

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Message-Id: <20220506131627.180784-2-pizhenwei@bytedance.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Stable-dep-of: fed93fb62e05 ("crypto: virtio - Handle dataq logic with tasklet")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-18 12:12:25 +01:00
..
Kconfig virtio-crypto: implement RSA algorithm 2024-11-18 12:12:25 +01:00
Makefile virtio-crypto: implement RSA algorithm 2024-11-18 12:12:25 +01:00
virtio_crypto_akcipher_algs.c virtio-crypto: change code style 2024-11-18 12:12:25 +01:00
virtio_crypto_algs.c virtio-crypto: change code style 2024-11-18 12:12:25 +01:00
virtio_crypto_common.h virtio-crypto: implement RSA algorithm 2024-11-18 12:12:25 +01:00
virtio_crypto_core.c virtio-crypto: implement RSA algorithm 2024-11-18 12:12:25 +01:00
virtio_crypto_mgr.c virtio-crypto: implement RSA algorithm 2024-11-18 12:12:25 +01:00