From: Chenghai Huang <huangchenghai2@huawei.com> When tail data is being compress, if the buffer data is not cleared, a nospace or again status needs to be returned to notify the user to add output space. Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com> --- drv/hisi_comp.c | 10 +++++----- v1/drv/hisi_zip_udrv.c | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drv/hisi_comp.c b/drv/hisi_comp.c index eaa8153..8fac2d1 100644 --- a/drv/hisi_comp.c +++ b/drv/hisi_comp.c @@ -320,7 +320,7 @@ static int check_store_buf(struct wd_comp_msg *msg) } else { /* Still data need to be copied */ buf->output_offset += copy_len; - req->status = WD_SUCCESS; + req->status = WD_EAGAIN; } return 1; @@ -347,10 +347,10 @@ static void copy_from_hw(struct wd_comp_msg *msg, struct hisi_comp_buf *buf) * The end flag is cached. It can be output only * after the data is completely copied to the output. */ - if (req->status == WD_STREAM_END) { - buf->status = WD_STREAM_END; - req->status = WD_EAGAIN; - } + if (req->status == WD_STREAM_END) + buf->status = req->status; + + req->status = WD_EAGAIN; } } diff --git a/v1/drv/hisi_zip_udrv.c b/v1/drv/hisi_zip_udrv.c index 6e2c8d4..f6c5ca9 100644 --- a/v1/drv/hisi_zip_udrv.c +++ b/v1/drv/hisi_zip_udrv.c @@ -210,10 +210,10 @@ static void copy_from_buf(struct wcrypto_comp_msg *msg, struct hisi_zip_buf *buf * The end flag is cached. It can be output only * after the data is completely copied to the output. */ - if (msg->status == WCRYPTO_DECOMP_END) { - buf->status = WCRYPTO_DECOMP_END; - msg->status = WCRYPTO_DECOMP_END_NOSPACE; - } + if (msg->status == WCRYPTO_DECOMP_END) + buf->status = msg->status; + + msg->status = WCRYPTO_DECOMP_END_NOSPACE; } } -- 2.33.0