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] [day] [month] [year] [list]
Message-ID: <1fbcfdd7-e2ad-450b-8670-df67132e9de1@intel.com>
Date: Mon, 16 Dec 2024 08:59:36 +0100
From: Przemek Kitszel <przemyslaw.kitszel@...el.com>
To: Junho Shon <sanoldfox@...er.com>
CC: <dsahern@...nel.org>, <kuba@...nel.org>, <edumazet@...gle.com>,
	<pabeni@...hat.com>, <davem@...emloft.net>, <horms@...nel.org>,
	<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Staging: rtl8723bs: Remove unnecessary static variable
 initialization

On 12/16/24 07:16, Junho Shon wrote:
> From: junoshon <sanoldfox@...er.com>
> 
> Fixed a coding style issue where the static variable '__tcp_tx_delay_enabled'
> was explicitly initialized to 0. Static variables are automatically zero-initialized
> by the compiler, so the explicit initialization is redundant.

Please don't post patches with the sole purpose of fixing minor style
issues. Also, the Subject line has wrong prefix.

Removing initialization of stack variables that will be assigned
unconditionally is of course a different kind of fix, still welcomed.

> 
> Signed-off-by: Junho Shon <sanoldfox@...er.com>
> ---
>   net/ipv4/tcp.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
> index 0d704bda6..b67887a69 100644
> --- a/net/ipv4/tcp.c
> +++ b/net/ipv4/tcp.c
> @@ -3498,7 +3498,7 @@ EXPORT_SYMBOL(tcp_tx_delay_enabled);
>   static void tcp_enable_tx_delay(void)
>   {
>   	if (!static_branch_unlikely(&tcp_tx_delay_enabled)) {
> -		static int __tcp_tx_delay_enabled = 0;

Even if not needed, it improves readability a bit.

> +		static int __tcp_tx_delay_enabled;
>   
>   		if (cmpxchg(&__tcp_tx_delay_enabled, 0, 1) == 0) {
>   			static_branch_enable(&tcp_tx_delay_enabled);


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ