netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next PATCH V2 1/2] macvtap: slient sparse warnings
@ 2013-06-13  6:23 Jason Wang
  2013-06-13  6:23 ` [net-next PATCH V2 2/2] macvtap: fix uninitialized return value macvtap_ioctl_set_queue() Jason Wang
  2013-06-13  8:23 ` [net-next PATCH V2 1/2] macvtap: slient sparse warnings David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Jason Wang @ 2013-06-13  6:23 UTC (permalink / raw)
  To: davem, netdev, linux-kernel; +Cc: edumazet, Jason Wang

This patch silents the following sparse warnings:

drivers/net/macvtap.c:98:9: warning: incorrect type in assignment (different
address spaces)
drivers/net/macvtap.c:98:9:    expected struct macvtap_queue *<noident>
drivers/net/macvtap.c:98:9:    got struct macvtap_queue [noderef]
<asn:4>*<noident>
drivers/net/macvtap.c:120:9: warning: incorrect type in assignment (different
address spaces)
drivers/net/macvtap.c:120:9:    expected struct macvtap_queue *<noident>
drivers/net/macvtap.c:120:9:    got struct macvtap_queue [noderef]
<asn:4>*<noident>
drivers/net/macvtap.c:151:22: error: incompatible types in comparison expression
(different address spaces)
drivers/net/macvtap.c:233:23: error: incompatible types in comparison expression
(different address spaces)
drivers/net/macvtap.c:243:23: error: incompatible types in comparison expression
(different address spaces)
drivers/net/macvtap.c:247:15: error: incompatible types in comparison expression
(different address spaces)
  CC [M]  drivers/net/macvtap.o
drivers/net/macvlan.c:232:24: error: incompatible types in comparison expression
(different address spaces)

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 drivers/net/macvtap.c      |    2 +-
 include/linux/if_macvlan.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 992151c..edcbf1c 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -429,7 +429,7 @@ static int macvtap_open(struct inode *inode, struct file *file)
 	if (!q)
 		goto out;
 
-	q->sock.wq = &q->wq;
+	RCU_INIT_POINTER(q->sock.wq, &q->wq);
 	init_waitqueue_head(&q->wq.wait);
 	q->sock.type = SOCK_RAW;
 	q->sock.state = SS_CONNECTED;
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
index 1912133..f49a9f6 100644
--- a/include/linux/if_macvlan.h
+++ b/include/linux/if_macvlan.h
@@ -70,7 +70,7 @@ struct macvlan_dev {
 	int (*receive)(struct sk_buff *skb);
 	int (*forward)(struct net_device *dev, struct sk_buff *skb);
 	/* This array tracks active taps. */
-	struct macvtap_queue	*taps[MAX_MACVTAP_QUEUES];
+	struct macvtap_queue	__rcu *taps[MAX_MACVTAP_QUEUES];
 	/* This list tracks all taps (both enabled and disabled) */
 	struct list_head	queue_list;
 	int			numvtaps;
-- 
1.7.1

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

* [net-next PATCH V2 2/2] macvtap: fix uninitialized return value macvtap_ioctl_set_queue()
  2013-06-13  6:23 [net-next PATCH V2 1/2] macvtap: slient sparse warnings Jason Wang
@ 2013-06-13  6:23 ` Jason Wang
  2013-06-13  8:23   ` David Miller
  2013-06-13  8:23 ` [net-next PATCH V2 1/2] macvtap: slient sparse warnings David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Jason Wang @ 2013-06-13  6:23 UTC (permalink / raw)
  To: davem, netdev, linux-kernel; +Cc: edumazet, Jason Wang

Return -EINVAL on illegal flag instead of uninitialized value. This fixes the
kbuild test warning.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 drivers/net/macvtap.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index edcbf1c..5a76f20 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -969,6 +969,8 @@ static int macvtap_ioctl_set_queue(struct file *file, unsigned int flags)
 		ret = macvtap_enable_queue(vlan->dev, file, q);
 	else if (flags & IFF_DETACH_QUEUE)
 		ret = macvtap_disable_queue(q);
+	else
+		ret = -EINVAL;
 
 	macvtap_put_vlan(vlan);
 	return ret;
-- 
1.7.1

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

* Re: [net-next PATCH V2 1/2] macvtap: slient sparse warnings
  2013-06-13  6:23 [net-next PATCH V2 1/2] macvtap: slient sparse warnings Jason Wang
  2013-06-13  6:23 ` [net-next PATCH V2 2/2] macvtap: fix uninitialized return value macvtap_ioctl_set_queue() Jason Wang
@ 2013-06-13  8:23 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2013-06-13  8:23 UTC (permalink / raw)
  To: jasowang; +Cc: netdev, linux-kernel, edumazet

From: Jason Wang <jasowang@redhat.com>
Date: Thu, 13 Jun 2013 14:23:35 +0800

> This patch silents the following sparse warnings:
 ...
> Signed-off-by: Jason Wang <jasowang@redhat.com>

Applied.

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

* Re: [net-next PATCH V2 2/2] macvtap: fix uninitialized return value macvtap_ioctl_set_queue()
  2013-06-13  6:23 ` [net-next PATCH V2 2/2] macvtap: fix uninitialized return value macvtap_ioctl_set_queue() Jason Wang
@ 2013-06-13  8:23   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2013-06-13  8:23 UTC (permalink / raw)
  To: jasowang; +Cc: netdev, linux-kernel, edumazet

From: Jason Wang <jasowang@redhat.com>
Date: Thu, 13 Jun 2013 14:23:36 +0800

> Return -EINVAL on illegal flag instead of uninitialized value. This fixes the
> kbuild test warning.
> 
> Signed-off-by: Jason Wang <jasowang@redhat.com>

Applied.

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

end of thread, other threads:[~2013-06-13  8:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-13  6:23 [net-next PATCH V2 1/2] macvtap: slient sparse warnings Jason Wang
2013-06-13  6:23 ` [net-next PATCH V2 2/2] macvtap: fix uninitialized return value macvtap_ioctl_set_queue() Jason Wang
2013-06-13  8:23   ` David Miller
2013-06-13  8:23 ` [net-next PATCH V2 1/2] macvtap: slient sparse warnings David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).