Skip to contentSkip to conversation

net: sunrpc: replace 0 with NULL

PATCH In review Jules Irenge 2 participants 2 messages Nov 25, 2019 – Nov 26, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: sunrpc: replace 0 with NULL

Replace 0 with NULL to fix warning detected by sparse tool.
warning: Using plain integer as NULL pointer

---
 net/sunrpc/xprtsock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/sunrpc/xprtsock.c +1 -1
index 70e52f567b2a..74d4ca06d572 100644
@@ -614,7 +614,7 @@ xs_read_stream_reply(struct sock_xprt *transport, struct msghdr *msg, int flags)
 static ssize_t
 xs_read_stream(struct sock_xprt *transport, int flags)
 {
-	struct msghdr msg = { 0 };
+	struct msghdr msg = { NULL };
 	size_t want, read = 0;
 	ssize_t ret = 0;
 
Signature · 1 line
2.23.0
#1 lore raw
Quoted 2 lines · Jules Irenge

Replace 0 with NULL to fix warning detected by sparse tool.
warning: Using plain integer as NULL pointer

[]

net/sunrpc/xprtsock.c

Quoted 1 line
net/sunrpc/xprtsock.c +0 -0

[]

net/sunrpc/xprtsock.c xs_read_stream_reply(struct sock_xprt *transport, struct msghdr *msg, int flags) · line 617

Quoted 6 lines
net/sunrpc/xprtsock.c +1 -1
@@ -614,7 +614,7 @@ xs_read_stream_reply(struct sock_xprt *transport, struct msghdr *msg, int flags)
 static ssize_t
 xs_read_stream(struct sock_xprt *transport, int flags)
 {
-	struct msghdr msg = { 0 };
+	struct msghdr msg = { NULL };

Rather than depending on the first member to be a pointer perhaps better to use the equivalent

	struct msghdr msg = {};