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: <wpr6eabfksol2sqmvifnivndnixberpoexcoskq5vbknvvadq3@4thpqbkkcyh5>
Date: Fri, 3 May 2024 13:55:34 +0300
From: Serge Semin <fancer.lancer@...il.com>
To: Yanteng Si <siyanteng@...ngson.cn>
Cc: andrew@...n.ch, hkallweit1@...il.com, peppe.cavallaro@...com, 
	alexandre.torgue@...s.st.com, joabreu@...opsys.com, Jose.Abreu@...opsys.com, 
	chenhuacai@...nel.org, linux@...linux.org.uk, guyinggang@...ngson.cn, 
	netdev@...r.kernel.org, chris.chenfeiyang@...il.com, siyanteng01@...il.com
Subject: Re: [PATCH net-next v12 04/15] net: stmmac: dwmac-loongson: Drop
 useless platform data

On Thu, Apr 25, 2024 at 09:04:35PM +0800, Yanteng Si wrote:
> The multicast_filter_bins is initialized twice, it should
> be 256, let's drop the first useless assignment.

Please drop the second plat_stmmacenet_data::multicast_filter_bins
init statement and just change the first one to initializing the
correct value - 256. Thus you'll have
1. the multicast and unicast filters size inits done in the same place;
2. the in-situ comments preserved (it's not like they're that much
helpful, but seeing the rest of the lines have a comment above it
would be nice to have the comment preserved here too);
3. dropped the statement closely attached to the return statement
(in kernel it's a widespread practice to separate the return
statement with an empty line).

The unit 1. is the main reason of course.

A bit more readable commit log would be:

"The plat_stmmacenet_data::multicast_filter_bins field is twice
initialized in the loongson_default_data() method. Drop the redundant
initialization, but for the readability sake keep the filters init
statements defined in the same place of the method."

-Serge(y)

> 
> Signed-off-by: Feiyang Chen <chenfeiyang@...ngson.cn>
> Signed-off-by: Yinggang Gu <guyinggang@...ngson.cn>
> Signed-off-by: Yanteng Si <siyanteng@...ngson.cn>
> ---
>  drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> index 9e40c28d453a..19906ea67636 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> @@ -15,9 +15,6 @@ static int loongson_default_data(struct plat_stmmacenet_data *plat)
>  	plat->has_gmac = 1;
>  	plat->force_sf_dma_mode = 1;
>  
> -	/* Set default value for multicast hash bins */
> -	plat->multicast_filter_bins = HASH_TABLE_SIZE;
> -
>  	/* Set default value for unicast filter entries */
>  	plat->unicast_filter_entries = 1;
>  
> -- 
> 2.31.4
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ