tun: Adjust on-stack tun_page initialization.
authorDavid S. Miller <davem@davemloft.net>
Sun, 18 Nov 2018 00:53:46 +0000 (16:53 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 18 Nov 2018 00:53:46 +0000 (16:53 -0800)
Instead of constantly playing with the struct initializer
syntax trying to make gcc and CLang both happy, just clear
it out using memset().

>> drivers/net/tun.c:2503:42: warning: Using plain integer as NULL pointer

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c

index e90a792..36163a1 100644 (file)
@@ -2500,10 +2500,12 @@ static int tun_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len)
                return -EBADFD;
 
        if (ctl && (ctl->type == TUN_MSG_PTR)) {
-               struct tun_page tpage = {0};
+               struct tun_page tpage;
                int n = ctl->num;
                int flush = 0;
 
+               memset(&tpage, 0, sizeof(tpage));
+
                local_bh_disable();
                rcu_read_lock();