public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
To: Junho Shon <sanoldfox@naver.com>
Cc: <dsahern@kernel.org>, <kuba@kernel.org>, <edumazet@google.com>,
	<pabeni@redhat.com>, <davem@davemloft.net>, <horms@kernel.org>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Staging: rtl8723bs: Remove unnecessary static variable initialization
Date: Mon, 16 Dec 2024 08:59:36 +0100	[thread overview]
Message-ID: <1fbcfdd7-e2ad-450b-8670-df67132e9de1@intel.com> (raw)
In-Reply-To: <20241216061625.2118125-1-sanoldfox@naver.com>

On 12/16/24 07:16, Junho Shon wrote:
> From: junoshon <sanoldfox@naver.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@naver.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);


      reply	other threads:[~2024-12-16  8:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-16  6:16 [PATCH] Staging: rtl8723bs: Remove unnecessary static variable initialization Junho Shon
2024-12-16  7:59 ` Przemek Kitszel [this message]

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=1fbcfdd7-e2ad-450b-8670-df67132e9de1@intel.com \
    --to=przemyslaw.kitszel@intel.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sanoldfox@naver.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