lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YtEmS//eV3Ok08BD@gondor.apana.org.au>
Date:   Fri, 15 Jul 2022 16:33:15 +0800
From:   Herbert Xu <herbert@...dor.apana.org.au>
To:     Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc:     Yang Shen <shenyang39@...wei.com>,
        Zhou Wang <wangzhou1@...ilicon.com>,
        "David S. Miller" <davem@...emloft.net>,
        linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
        linux-crypto@...r.kernel.org
Subject: Re: [PATCH] crypto: hisilicon/zip: Use the bitmap API to allocate
 bitmaps

On Sat, Jul 09, 2022 at 06:16:46PM +0200, Christophe JAILLET wrote:
> Use bitmap_zalloc()/bitmap_free() instead of hand-writing them.
> 
> It is less verbose and it improves the semantic.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
>  drivers/crypto/hisilicon/zip/zip_crypto.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/crypto/hisilicon/zip/zip_crypto.c b/drivers/crypto/hisilicon/zip/zip_crypto.c
> index 67869513e48c..7bf53877e508 100644
> --- a/drivers/crypto/hisilicon/zip/zip_crypto.c
> +++ b/drivers/crypto/hisilicon/zip/zip_crypto.c
> @@ -606,8 +606,7 @@ static int hisi_zip_create_req_q(struct hisi_zip_ctx *ctx)
>  		req_q = &ctx->qp_ctx[i].req_q;
>  		req_q->size = QM_Q_DEPTH;
>  
> -		req_q->req_bitmap = kcalloc(BITS_TO_LONGS(req_q->size),
> -					    sizeof(long), GFP_KERNEL);
> +		req_q->req_bitmap = bitmap_zalloc(req_q->size, GFP_KERNEL);
>  		if (!req_q->req_bitmap) {
>  			ret = -ENOMEM;
>  			if (i == 0)

You should add an include for linux/bitmap.h instead of relying
on implicit inclusion through some random header file.

The same goes for all your other patches too.

Thanks,
-- 
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ