Skip to content

Commit 7747cff

Browse files
yumeng0117herbertx
authored andcommitted
crypto: hisilicon/hpre - remove useless code
1. Remove unused member 'debug_root' in 'struct hpre_debug'; 2. The u64 cast is redundant in 'cpu_to_le64'. Fixes: 8489741("crypto: hisilicon - Add debugfs for HPRE") Fixes: dadbe4c("crypto: hisilicon/hpre - update debugfs ...") Signed-off-by: Meng Yu <yumeng18@huawei.com> Reviewed-by: Zaibo Xu <xuzaibo@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 74d0dcd commit 7747cff

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

drivers/crypto/hisilicon/hpre/hpre.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ struct hpre_dfx {
5656
* Just relevant for PF.
5757
*/
5858
struct hpre_debug {
59-
struct dentry *debug_root;
6059
struct hpre_dfx dfx[HPRE_DFX_FILE_NUM];
6160
struct hpre_debugfs_file files[HPRE_DEBUGFS_FILE_NUM];
6261
};

drivers/crypto/hisilicon/hpre/hpre_crypto.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ static int hpre_msg_request_set(struct hpre_ctx *ctx, void *req, bool is_rsa)
474474
h_req->areq.dh = kreq;
475475
msg = &h_req->req;
476476
memset(msg, 0, sizeof(*msg));
477-
msg->key = cpu_to_le64((u64)ctx->dh.dma_xa_p);
477+
msg->key = cpu_to_le64(ctx->dh.dma_xa_p);
478478
}
479479

480480
msg->dw0 |= cpu_to_le32(0x1 << HPRE_SQE_DONE_SHIFT);
@@ -740,7 +740,7 @@ static int hpre_rsa_enc(struct akcipher_request *req)
740740
return ret;
741741

742742
msg->dw0 |= cpu_to_le32(HPRE_ALG_NC_NCRT);
743-
msg->key = cpu_to_le64((u64)ctx->rsa.dma_pubkey);
743+
msg->key = cpu_to_le64(ctx->rsa.dma_pubkey);
744744

745745
ret = hpre_hw_data_init(hpre_req, req->src, req->src_len, 1, 0);
746746
if (unlikely(ret))
@@ -788,11 +788,11 @@ static int hpre_rsa_dec(struct akcipher_request *req)
788788
return ret;
789789

790790
if (ctx->crt_g2_mode) {
791-
msg->key = cpu_to_le64((u64)ctx->rsa.dma_crt_prikey);
791+
msg->key = cpu_to_le64(ctx->rsa.dma_crt_prikey);
792792
msg->dw0 = cpu_to_le32(le32_to_cpu(msg->dw0) |
793793
HPRE_ALG_NC_CRT);
794794
} else {
795-
msg->key = cpu_to_le64((u64)ctx->rsa.dma_prikey);
795+
msg->key = cpu_to_le64(ctx->rsa.dma_prikey);
796796
msg->dw0 = cpu_to_le32(le32_to_cpu(msg->dw0) |
797797
HPRE_ALG_NC_NCRT);
798798
}

0 commit comments

Comments
 (0)