projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
xenserver: Don't delete pidfile when stopping monitor-external-ids
[openvswitch]
/
lib
/
odp-util.c
diff --git
a/lib/odp-util.c
b/lib/odp-util.c
index ccf05c6bd4259eb99783201edd160db06892556d..442c939a7d5096ca59d0579176653e8a92e1c952 100644
(file)
--- a/
lib/odp-util.c
+++ b/
lib/odp-util.c
@@
-30,13
+30,10
@@
union odp_action *
odp_actions_add(struct odp_actions *actions, uint16_t type)
{
union odp_action *a;
odp_actions_add(struct odp_actions *actions, uint16_t type)
{
union odp_action *a;
- if (actions->n_actions < MAX_ODP_ACTIONS) {
- a = &actions->actions[actions->n_actions++];
- } else {
- COVERAGE_INC(odp_overflow);
- actions->n_actions = MAX_ODP_ACTIONS + 1;
- a = &actions->actions[MAX_ODP_ACTIONS - 1];
- }
+ size_t idx;
+
+ idx = actions->n_actions++ & (MAX_ODP_ACTIONS - 1);
+ a = &actions->actions[idx];
memset(a, 0, sizeof *a);
a->type = type;
return a;
memset(a, 0, sizeof *a);
a->type = type;
return a;