diff mbox series

[3/4] netlink: Delete an unnecessary variable initialisation in __netlink_kernel_create()

Message ID 57779d2f-0d39-4c2e-8718-3c9242177013@web.de (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series netlink: Adjustments for __netlink_kernel_create() | expand

Checks

Context Check Description
netdev/series_format warning 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: 1118 this patch: 1118
netdev/cc_maintainers success CCed 4 of 4 maintainers
netdev/build_clang success Errors and warnings before: 1144 this patch: 1144
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: 1145 this patch: 1145
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Markus Elfring Dec. 31, 2023, 5:46 p.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 31 Dec 2023 17:45:00 +0100

The variable “listeners” will eventually be set to an appropriate pointer
a bit later. Thus omit the explicit initialisation at the beginning.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 net/netlink/af_netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.43.0

Comments

Stephen Hemminger Jan. 1, 2024, 6:42 p.m. UTC | #1
On Sun, 31 Dec 2023 18:46:09 +0100
Markus Elfring <Markus.Elfring@web.de> wrote:

> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sun, 31 Dec 2023 17:45:00 +0100
> 
> The variable “listeners” will eventually be set to an appropriate pointer
> a bit later. Thus omit the explicit initialisation at the beginning.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

This looks OK, and the compiler would catch if it was a problem.
Not really necessary though.

Acked-by: Stephen Hemminger <stephen@networkplumber.org>
diff mbox series

Patch

diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index b71d9c21d15b..cfddc9c6a376 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -2018,7 +2018,7 @@  __netlink_kernel_create(struct net *net, int unit, struct module *module,
 	struct socket *sock;
 	struct sock *sk;
 	struct netlink_sock *nlk;
-	struct listeners *listeners = NULL;
+	struct listeners *listeners;
 	struct mutex *cb_mutex = cfg ? cfg->cb_mutex : NULL;
 	unsigned int groups;