> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of Shukun Tan
> Sent: Friday, May 8, 2020 6:58 PM
> To: [email protected]; [email protected]
> Cc: [email protected]; Xu Zaibo <[email protected]>; Wangzhou (B) 
> <[email protected]>
> Subject: [PATCH 13/13] crypto: hisilicon/zip - Make negative compression not 
> an error

> From: Zhou Wang <[email protected]>

> Users can decide whether to use negative compression result, so it should not 
> be reported as an error by driver.

> Signed-off-by: Zhou Wang <[email protected]>
> Signed-off-by: Shukun Tan <[email protected]>
> ---
>  drivers/crypto/hisilicon/zip/zip_crypto.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

> diff --git a/drivers/crypto/hisilicon/zip/zip_crypto.c 
> b/drivers/crypto/hisilicon/zip/zip_crypto.c
> index 5fb9d4b..0f158d4 100644
> --- a/drivers/crypto/hisilicon/zip/zip_crypto.c
> +++ b/drivers/crypto/hisilicon/zip/zip_crypto.c
@@ -341,7 +341,7 @@ static void hisi_zip_acomp_cb(struct hisi_qp *qp, void 
*data)
 
>       status = sqe->dw3 & HZIP_BD_STATUS_M;
 
> -     if (status != 0 && status != HZIP_NC_ERR) {
> +     if (status != 0) {

Hi Zhou, it seems your comment is saying we won't report errors for some cases. 
But the code seems to report more errors by removing the "&&" as the condition 
becomes weaker.
Anything have I lost?

>               dev_err(dev, "%scompress fail in qp%u: %u, output: %u\n",
>                       (qp->alg_type == 0) ? "" : "de", qp->qp_id, status,
>                       sqe->produced);

Best Regards
Barry

Reply via email to