mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christian Lamparter <chunkeey@gmail.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	Christian Lamparter <chunkeey@googlemail.com>,
	Kalle Valo <kvalo@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [RESEND] [PATCH] p54: Use the bitmap API to allocate bitmaps
Date: Thu, 7 Jul 2022 11:13:03 +0200	[thread overview]
Message-ID: <1e1c7c7e-ef86-e4c9-92cc-f28bf6ec6b8a@gmail.com> (raw)
In-Reply-To: <2755b8b7d85a2db0663d39ea6df823f94f3401b3.1656939750.git.christophe.jaillet@wanadoo.fr>

Hi,

I'm sending this again because Android added HTML. Sorry for that.

On 04/07/2022 15:02, 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@wanadoo.fr>
Acked-by: Christian Lamparter <chunkeey@gmail.com>

> ---
>   drivers/net/wireless/intersil/p54/fwio.c | 6 ++----
>   drivers/net/wireless/intersil/p54/main.c | 2 +-
>   2 files changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/wireless/intersil/p54/fwio.c b/drivers/net/wireless/intersil/p54/fwio.c
> index bece14e4ff0d..b52cce38115d 100644
> --- a/drivers/net/wireless/intersil/p54/fwio.c
> +++ b/drivers/net/wireless/intersil/p54/fwio.c
> @@ -173,10 +173,8 @@ int p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw)
>   		 * keeping a extra list for uploaded keys.
>   		 */
>   
> -		priv->used_rxkeys = kcalloc(BITS_TO_LONGS(priv->rx_keycache_size),
> -					    sizeof(long),
> -					    GFP_KERNEL);
> -
> +		priv->used_rxkeys = bitmap_zalloc(priv->rx_keycache_size,
> +						  GFP_KERNEL);
>   		if (!priv->used_rxkeys)
>   			return -ENOMEM;
>   	}
> diff --git a/drivers/net/wireless/intersil/p54/main.c b/drivers/net/wireless/intersil/p54/main.c
> index 115be1f3f33d..c1e1711382a7 100644
> --- a/drivers/net/wireless/intersil/p54/main.c
> +++ b/drivers/net/wireless/intersil/p54/main.c
> @@ -830,7 +830,7 @@ void p54_free_common(struct ieee80211_hw *dev)
>   	kfree(priv->output_limit);
>   	kfree(priv->curve_data);
>   	kfree(priv->rssi_db);
> -	kfree(priv->used_rxkeys);
> +	bitmap_free(priv->used_rxkeys);
>   	kfree(priv->survey);
>   	priv->iq_autocal = NULL;
>   	priv->output_limit = NULL;


  reply	other threads:[~2022-07-07  9:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-04 13:02 Christophe JAILLET
2022-07-07  9:13 ` Christian Lamparter [this message]
2022-07-18 11:52 ` wifi: " Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1e1c7c7e-ef86-e4c9-92cc-f28bf6ec6b8a@gmail.com \
    --to=chunkeey@gmail.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=chunkeey@googlemail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome