netdev: Make 'smap' variable const in netdev_set_qos().
authorBen Pfaff <blp@nicira.com>
Fri, 26 Apr 2013 18:13:04 +0000 (11:13 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 3 May 2013 20:29:47 +0000 (13:29 -0700)
This makes this code more obviously thread-safe.

Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/netdev.c

index 156984a..434e257 100644 (file)
@@ -1115,7 +1115,7 @@ netdev_set_qos(struct netdev *netdev,
 
     if (class->set_qos) {
         if (!details) {
-            static struct smap empty = SMAP_INITIALIZER(&empty);
+            static const struct smap empty = SMAP_INITIALIZER(&empty);
             details = &empty;
         }
         return class->set_qos(netdev, type, details);