net: sunrpc: replace 0 with NULL
diff mbox series

Message ID 20191125225239.384343-1-jbi.octave@gmail.com
State New
Headers show
Series
  • net: sunrpc: replace 0 with NULL
Related show

Commit Message

Jules Irenge Nov. 25, 2019, 10:52 p.m. UTC
Replace 0 with NULL to fix warning detected by sparse tool.
warning: Using plain integer as NULL pointer

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 net/sunrpc/xprtsock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Joe Perches Nov. 26, 2019, 4:38 p.m. UTC | #1
On Mon, 2019-11-25 at 22:52 +0000, Jules Irenge wrote:
> Replace 0 with NULL to fix warning detected by sparse tool.
> warning: Using plain integer as NULL pointer
[]
> diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
[]
> @@ -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 = {};

Patch
diff mbox series

diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 70e52f567b2a..74d4ca06d572 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -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;