mirror of
https://github.com/openvswitch/ovs
synced 2025-09-01 06:45:17 +00:00
Embrace anonymous unions.
Several OVS structs contain embedded named unions, like this: struct { ... union { ... } u; }; C11 standardized a feature that many compilers already implemented anyway, where an embedded union may be unnamed, like this: struct { ... union { ... }; }; This is more convenient because it allows the programmer to omit "u." in many places. OVS already used this feature in several places. This commit embraces it in several others. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org> Tested-by: Alin Gabriel Serdean <aserdean@ovn.org> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
This commit is contained in:
@@ -3061,19 +3061,19 @@ dpif_netdev_operate(struct dpif *dpif, struct dpif_op **ops, size_t n_ops)
|
||||
|
||||
switch (op->type) {
|
||||
case DPIF_OP_FLOW_PUT:
|
||||
op->error = dpif_netdev_flow_put(dpif, &op->u.flow_put);
|
||||
op->error = dpif_netdev_flow_put(dpif, &op->flow_put);
|
||||
break;
|
||||
|
||||
case DPIF_OP_FLOW_DEL:
|
||||
op->error = dpif_netdev_flow_del(dpif, &op->u.flow_del);
|
||||
op->error = dpif_netdev_flow_del(dpif, &op->flow_del);
|
||||
break;
|
||||
|
||||
case DPIF_OP_EXECUTE:
|
||||
op->error = dpif_netdev_execute(dpif, &op->u.execute);
|
||||
op->error = dpif_netdev_execute(dpif, &op->execute);
|
||||
break;
|
||||
|
||||
case DPIF_OP_FLOW_GET:
|
||||
op->error = dpif_netdev_flow_get(dpif, &op->u.flow_get);
|
||||
op->error = dpif_netdev_flow_get(dpif, &op->flow_get);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user