Linux-NFS Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] net: sunrpc:  replace 0 with NULL
@ 2019-11-25 22:52 Jules Irenge
  2019-11-26 16:38 ` Joe Perches
  0 siblings, 1 reply; 2+ messages in thread
From: Jules Irenge @ 2019-11-25 22:52 UTC (permalink / raw)
  To: trond.myklebust
  Cc: anna.schumaker, davem, linux-nfs, netdev, linux-kernel, Jules Irenge

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(-)

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;
 
-- 
2.23.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: sunrpc:  replace 0 with NULL
  2019-11-25 22:52 [PATCH] net: sunrpc: replace 0 with NULL Jules Irenge
@ 2019-11-26 16:38 ` Joe Perches
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2019-11-26 16:38 UTC (permalink / raw)
  To: Jules Irenge, trond.myklebust
  Cc: anna.schumaker, davem, linux-nfs, netdev, linux-kernel

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 = {};



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-25 22:52 [PATCH] net: sunrpc: replace 0 with NULL Jules Irenge
2019-11-26 16:38 ` Joe Perches

Linux-NFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nfs/0 linux-nfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nfs linux-nfs/ https://lore.kernel.org/linux-nfs \
		linux-nfs@vger.kernel.org
	public-inbox-index linux-nfs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-nfs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git