diff options
| author | Ben Pfaff <blp@nicira.com> | 2010-09-17 10:33:10 -0700 |
|---|---|---|
| committer | Ben Pfaff <blp@nicira.com> | 2010-10-01 10:25:29 -0700 |
| commit | 4e8e4213a815a30216e855a805a8bcd5b8c5a886 (patch) | |
| tree | 38dbb503be4f22ae804f3e5f83459c975d83886a /lib/netdev-linux.c | |
| parent | adf7cfd851c3d9d6f1ad74653cbd2fecce8c3ba9 (diff) | |
| download | openvswitch-4e8e4213a815a30216e855a805a8bcd5b8c5a886.tar.gz | |
Switch many macros from using CONTAINER_OF to using OBJECT_CONTAINING.
These macros require one fewer argument by switching, which makes code
that uses them shorter and more readable.
Diffstat (limited to 'lib/netdev-linux.c')
| -rw-r--r-- | lib/netdev-linux.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index eecff5034..e1a3c8c46 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -1483,8 +1483,7 @@ tc_find_queue__(const struct netdev *netdev, unsigned int queue_id, netdev_dev_linux_cast(netdev_get_dev(netdev)); struct tc_queue *queue; - HMAP_FOR_EACH_IN_BUCKET (queue, struct tc_queue, hmap_node, - hash, &netdev_dev->tc->queues) { + HMAP_FOR_EACH_IN_BUCKET (queue, hmap_node, hash, &netdev_dev->tc->queues) { if (queue->queue_id == queue_id) { return queue; } @@ -1679,8 +1678,7 @@ netdev_linux_dump_queues(const struct netdev *netdev, last_error = 0; shash_init(&details); - HMAP_FOR_EACH (queue, struct tc_queue, hmap_node, - &netdev_dev->tc->queues) { + HMAP_FOR_EACH (queue, hmap_node, &netdev_dev->tc->queues) { shash_clear(&details); error = netdev_dev->tc->ops->class_get(netdev, queue, &details); @@ -2012,7 +2010,7 @@ static void poll_notify(struct list *list) { struct netdev_linux_notifier *notifier; - LIST_FOR_EACH (notifier, struct netdev_linux_notifier, node, list) { + LIST_FOR_EACH (notifier, node, list) { struct netdev_notifier *n = ¬ifier->notifier; n->cb(n); } @@ -2551,8 +2549,7 @@ htb_tc_destroy(struct tc *tc) struct htb *htb = CONTAINER_OF(tc, struct htb, tc); struct htb_class *hc, *next; - HMAP_FOR_EACH_SAFE (hc, next, struct htb_class, tc_queue.hmap_node, - &htb->tc.queues) { + HMAP_FOR_EACH_SAFE (hc, next, tc_queue.hmap_node, &htb->tc.queues) { hmap_remove(&htb->tc.queues, &hc->tc_queue.hmap_node); free(hc); } |
