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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 6 Jul 2022 08:53:06 +0100
From:   Martin Habets <habetsm.xilinx@...il.com>
To:     Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc:     Edward Cree <ecree.xilinx@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, linux-kernel@...r.kernel.org,
        kernel-janitors@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH] sfc/siena: Use the bitmap API to allocate bitmaps

Please use "PATCH net-next" in these kind of patches for netdev.
See Documentation/process/maintainer-netdev.rst

On Tue, Jul 05, 2022 at 09:34:08PM +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>

Acked-by: Martin Habets <habetsm.xilinx@...il.com>

> ---
>  drivers/net/ethernet/sfc/siena/farch.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/sfc/siena/farch.c b/drivers/net/ethernet/sfc/siena/farch.c
> index cce23803c652..89ccd65c978b 100644
> --- a/drivers/net/ethernet/sfc/siena/farch.c
> +++ b/drivers/net/ethernet/sfc/siena/farch.c
> @@ -2778,7 +2778,7 @@ void efx_farch_filter_table_remove(struct efx_nic *efx)
>  	enum efx_farch_filter_table_id table_id;
>  
>  	for (table_id = 0; table_id < EFX_FARCH_FILTER_TABLE_COUNT; table_id++) {
> -		kfree(state->table[table_id].used_bitmap);
> +		bitmap_free(state->table[table_id].used_bitmap);
>  		vfree(state->table[table_id].spec);
>  	}
>  	kfree(state);
> @@ -2822,9 +2822,7 @@ int efx_farch_filter_table_probe(struct efx_nic *efx)
>  		table = &state->table[table_id];
>  		if (table->size == 0)
>  			continue;
> -		table->used_bitmap = kcalloc(BITS_TO_LONGS(table->size),
> -					     sizeof(unsigned long),
> -					     GFP_KERNEL);
> +		table->used_bitmap = bitmap_zalloc(table->size, GFP_KERNEL);
>  		if (!table->used_bitmap)
>  			goto fail;
>  		table->spec = vzalloc(array_size(sizeof(*table->spec),
> -- 
> 2.34.1

Powered by blists - more mailing lists