[ovs-dev] [PATCH 1/2] netdev: Allow netdev_change_seq_changed() to accept const pointers.

Ethan Jackson ethan at nicira.com
Wed May 7 20:36:48 UTC 2014


This fixes the following warning in the DPDK code.

../lib/netdev-dpdk.c:790:31: error: passing 'const struct netdev *' to
parameter of type 'struct netdev *' discards qualifiers

Signed-off-by: Ethan Jackson <ethan at nicira.com>
---
 lib/netdev-provider.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/netdev-provider.h b/lib/netdev-provider.h
index c2123dc..37b9da3 100644
--- a/lib/netdev-provider.h
+++ b/lib/netdev-provider.h
@@ -56,8 +56,9 @@ struct netdev {
 };
 
 static void
-netdev_change_seq_changed(struct netdev *netdev)
+netdev_change_seq_changed(const struct netdev *netdev_)
 {
+    struct netdev *netdev = CONST_CAST(struct netdev *, netdev_);
     seq_change(connectivity_seq_get());
     netdev->change_seq++;
     if (!netdev->change_seq) {
-- 
1.8.1.2




More information about the dev mailing list