Modify the parameter type and invalid return value check.
Signed-off-by: Zhiqi Song songzhiqi1@huawei.com --- drv/isa_ce_sm3.c | 8 ++++---- drv/isa_ce_sm3.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drv/isa_ce_sm3.c b/drv/isa_ce_sm3.c index ace6905..2789a08 100644 --- a/drv/isa_ce_sm3.c +++ b/drv/isa_ce_sm3.c @@ -50,7 +50,7 @@ static void __attribute__((constructor)) sm3_ce_probe(void)
WD_INFO("Info: register SM3 CE alg driver!\n"); ret = wd_alg_driver_register(&sm3_ce_alg_driver); - if (ret && ret != WD_ENODEV) + if (ret && ret != -WD_ENODEV) WD_ERR("Error: register SM3 CE failed!\n"); }
@@ -97,7 +97,7 @@ static void sm3_ce_init_ex(struct sm3_ce_ctx *sctx, __u8 *iv, __u16 iv_bytes) PUTU8_TO_U32(sctx->word_reg[i], iv + i * WORD_TO_CHAR_OFFSET); }
-static void sm3_ce_update(struct sm3_ce_ctx *sctx, const void *data, +static void sm3_ce_update(struct sm3_ce_ctx *sctx, const __u8 *data, size_t data_len, sm3_ce_block_fn *block_fn) { size_t remain_data_len, blk_num; @@ -222,7 +222,7 @@ static int do_sm3_ce(struct wd_digest_msg *msg, __u8 *out_digest) }
static void sm3_hmac_key_padding(struct hmac_sm3_ctx *hctx, - const uint8_t *key, size_t key_len) + const __u8 *key, size_t key_len) { size_t i;
@@ -243,7 +243,7 @@ static void sm3_hmac_key_padding(struct hmac_sm3_ctx *hctx, } }
-static void sm3_ce_hmac_init(struct hmac_sm3_ctx *hctx, const uint8_t *key, size_t key_len) +static void sm3_ce_hmac_init(struct hmac_sm3_ctx *hctx, const __u8 *key, size_t key_len) { sm3_hmac_key_padding(hctx, key, key_len);
diff --git a/drv/isa_ce_sm3.h b/drv/isa_ce_sm3.h index 7f68e6e..13edb0a 100644 --- a/drv/isa_ce_sm3.h +++ b/drv/isa_ce_sm3.h @@ -77,7 +77,7 @@ struct sm3_ce_drv_ctx { };
void sm3_ce_block_compress(__u32 word_reg[SM3_STATE_WORDS], - const unsigned char *src, size_t blocks); + const __u8 *src, size_t blocks);
#ifdef __cplusplus }