diff mbox series

Staging: rtl8723bs: Remove unnecessary static variable initialization

Message ID 20241216061625.2118125-1-sanoldfox@naver.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series Staging: rtl8723bs: Remove unnecessary static variable initialization | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 5 this patch: 5
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch warning WARNING: From:/Signed-off-by: email name mismatch: 'From: junoshon <sanoldfox@naver.com>' != 'Signed-off-by: Junho Shon <sanoldfox@naver.com>'
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 1 this patch: 1
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-12-16--09-00 (tests: 795)

Commit Message

Junho Shon Dec. 16, 2024, 6:16 a.m. UTC
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.

Signed-off-by: Junho Shon <sanoldfox@naver.com>
---
 net/ipv4/tcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Przemek Kitszel Dec. 16, 2024, 7:59 a.m. UTC | #1
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);
diff mbox series

Patch

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;
+		static int __tcp_tx_delay_enabled;
 
 		if (cmpxchg(&__tcp_tx_delay_enabled, 0, 1) == 0) {
 			static_branch_enable(&tcp_tx_delay_enabled);