From: Chenghai Huang <huangchenghai2@huawei.com> When the output space is too large, the function is not affected. Therefore, the printf of displaying a large number of messages is deleted. Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com> --- v1/drv/hisi_zip_udrv.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/v1/drv/hisi_zip_udrv.c b/v1/drv/hisi_zip_udrv.c index f6c5ca9..6761b9c 100644 --- a/v1/drv/hisi_zip_udrv.c +++ b/v1/drv/hisi_zip_udrv.c @@ -315,11 +315,9 @@ int qm_fill_zip_sqe(void *smsg, struct qm_queue_info *info, __u16 i) WD_ERR("The in_len is out of range in_len(%u)!\n", msg->in_size); return -WD_EINVAL; } - if (unlikely(msg->data_fmt != WD_SGL_BUF && msg->avail_out > MAX_BUFFER_SIZE)) { - WD_ERR("warning: avail_out is out of range (%u), will set 8MB size max!\n", - msg->avail_out); + if (unlikely(msg->data_fmt != WD_SGL_BUF && msg->avail_out > MAX_BUFFER_SIZE)) msg->avail_out = MAX_BUFFER_SIZE; - } + sqe->input_data_length = msg->in_size; sqe->dest_avail_out = msg->avail_out; @@ -500,11 +498,8 @@ static int fill_zip_buffer_size_deflate(void *ssqe, struct wcrypto_comp_msg *msg } if (unlikely(msg->data_fmt != WD_SGL_BUF && - msg->avail_out > MAX_BUFFER_SIZE)) { - WD_ERR("warning: avail_out is out of range (%u), will set 8MB size max!\n", - msg->avail_out); + msg->avail_out > MAX_BUFFER_SIZE)) msg->avail_out = MAX_BUFFER_SIZE; - } sqe->input_data_length = msg->in_size; sqe->dest_avail_out = msg->avail_out; @@ -547,11 +542,8 @@ static int fill_zip_buffer_size_zstd(void *ssqe, struct wcrypto_comp_msg *msg) /* fill the sequences output size */ sqe->dest_avail_out = zstd_out->seq_sz; } else { - if (unlikely(msg->avail_out > MAX_BUFFER_SIZE)) { - WD_ERR("warning: avail_out is out of range (%u), will set 8MB size max!\n", - msg->avail_out); - msg->avail_out = MAX_BUFFER_SIZE; - } + if (unlikely(msg->avail_out > MAX_BUFFER_SIZE + lit_size)) + msg->avail_out = MAX_BUFFER_SIZE + lit_size; /* * For lz77_zstd, the hardware need 784 Bytes buffer to output -- 2.33.0