Skip to content

Commit

Permalink
Rename NOT_REACHED to OVS_NOT_REACHED
Browse files Browse the repository at this point in the history
This allows other libraries to use util.h that has already
defined NOT_REACHED.

Signed-off-by: Harold Lim <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
Harold Lim authored and blp committed Dec 17, 2013
1 parent 037821c commit 428b2ed
Show file tree
Hide file tree
Showing 55 changed files with 234 additions and 234 deletions.
2 changes: 1 addition & 1 deletion CodingStyle
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ statement, that is, write "return 0;" and not "return(0);"
break;

default:
NOT_REACHED();
OVS_NOT_REACHED();
}

"switch" statements with very short, uniform cases may use an
Expand Down
4 changes: 2 additions & 2 deletions lib/async-append-null.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ void
async_append_write(struct async_append *ap OVS_UNUSED,
const void *data OVS_UNUSED, size_t size OVS_UNUSED)
{
NOT_REACHED();
OVS_NOT_REACHED();
}

void
async_append_flush(struct async_append *ap OVS_UNUSED)
{
NOT_REACHED();
OVS_NOT_REACHED();
}
2 changes: 1 addition & 1 deletion lib/bfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ bfd_process_packet(struct bfd *bfd, const struct flow *flow,
break;
case STATE_ADMIN_DOWN:
default:
NOT_REACHED();
OVS_NOT_REACHED();
}
}
/* XXX: RFC 5880 Section 6.8.6 Demand mode related calculations here. */
Expand Down
2 changes: 1 addition & 1 deletion lib/bundle.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ bundle_execute(const struct ofpact_bundle *bundle,
return execute_ab(bundle, slave_enabled, aux);

default:
NOT_REACHED();
OVS_NOT_REACHED();
}
}

Expand Down
6 changes: 3 additions & 3 deletions lib/cfm.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,18 +236,18 @@ static int
ccm_interval_to_ms(uint8_t interval)
{
switch (interval) {
case 0: NOT_REACHED(); /* Explicitly not supported by 802.1ag. */
case 0: OVS_NOT_REACHED(); /* Explicitly not supported by 802.1ag. */
case 1: return 3; /* Not recommended due to timer resolution. */
case 2: return 10; /* Not recommended due to timer resolution. */
case 3: return 100;
case 4: return 1000;
case 5: return 10000;
case 6: return 60000;
case 7: return 600000;
default: NOT_REACHED(); /* Explicitly not supported by 802.1ag. */
default: OVS_NOT_REACHED(); /* Explicitly not supported by 802.1ag. */
}

NOT_REACHED();
OVS_NOT_REACHED();
}

static long long int
Expand Down
2 changes: 1 addition & 1 deletion lib/daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ fork_and_wait_for_startup(int *fdp)
} else if (retval < 0) {
VLOG_FATAL("waitpid failed (%s)", ovs_strerror(errno));
} else {
NOT_REACHED();
OVS_NOT_REACHED();
}
}
close(fds[0]);
Expand Down
4 changes: 2 additions & 2 deletions lib/dpif-linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ dpif_linux_operate__(struct dpif *dpif_, struct dpif_op **ops, size_t n_ops)
break;

default:
NOT_REACHED();
OVS_NOT_REACHED();
}
}

Expand Down Expand Up @@ -1253,7 +1253,7 @@ dpif_linux_operate__(struct dpif *dpif_, struct dpif_op **ops, size_t n_ops)
break;

default:
NOT_REACHED();
OVS_NOT_REACHED();
}

ofpbuf_uninit(&aux->request);
Expand Down
2 changes: 1 addition & 1 deletion lib/dpif.c
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,7 @@ dpif_operate(struct dpif *dpif, struct dpif_op **ops, size_t n_ops)
break;

default:
NOT_REACHED();
OVS_NOT_REACHED();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/fatal-signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ fatal_signal_run(void)
raise(sig_nr);

ovs_mutex_unlock(&mutex);
NOT_REACHED();
OVS_NOT_REACHED();
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ flow_mask_hash_fields(const struct flow *flow, struct flow_wildcards *wc,
break;

default:
NOT_REACHED();
OVS_NOT_REACHED();
}
}

Expand All @@ -958,7 +958,7 @@ flow_hash_fields(const struct flow *flow, enum nx_hash_fields fields,
return flow_hash_symmetric_l4(flow, basis);
}

NOT_REACHED();
OVS_NOT_REACHED();
}

/* Returns a string representation of 'fields'. */
Expand Down
16 changes: 8 additions & 8 deletions lib/json.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ json_destroy(struct json *json)
break;

case JSON_N_TYPES:
NOT_REACHED();
OVS_NOT_REACHED();
}
free(json);
}
Expand Down Expand Up @@ -417,7 +417,7 @@ json_clone(const struct json *json)

case JSON_N_TYPES:
default:
NOT_REACHED();
OVS_NOT_REACHED();
}
}

Expand Down Expand Up @@ -502,7 +502,7 @@ json_hash(const struct json *json, size_t basis)

case JSON_N_TYPES:
default:
NOT_REACHED();
OVS_NOT_REACHED();
}
}

Expand Down Expand Up @@ -573,7 +573,7 @@ json_equal(const struct json *a, const struct json *b)

case JSON_N_TYPES:
default:
NOT_REACHED();
OVS_NOT_REACHED();
}
}

Expand Down Expand Up @@ -1175,7 +1175,7 @@ json_parser_put_value(struct json_parser *p, struct json *value)
} else if (node->json->type == JSON_ARRAY) {
json_array_add(node->json, value);
} else {
NOT_REACHED();
OVS_NOT_REACHED();
}
}

Expand Down Expand Up @@ -1295,7 +1295,7 @@ json_parser_pop(struct json_parser *p)
} else if (node->json->type == JSON_OBJECT) {
p->parse_state = JSON_PARSE_OBJECT_NEXT;
} else {
NOT_REACHED();
OVS_NOT_REACHED();
}
}
}
Expand Down Expand Up @@ -1502,7 +1502,7 @@ json_serialize(const struct json *json, struct json_serializer *s)

case JSON_N_TYPES:
default:
NOT_REACHED();
OVS_NOT_REACHED();
}
}

Expand Down Expand Up @@ -1750,6 +1750,6 @@ json_serialized_length(const struct json *json)

case JSON_N_TYPES:
default:
NOT_REACHED();
OVS_NOT_REACHED();
}
}
2 changes: 1 addition & 1 deletion lib/lacp.c
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ lacp_print_details(struct ds *ds, struct lacp *lacp) OVS_REQUIRES(mutex)
status = "defaulted";
break;
default:
NOT_REACHED();
OVS_NOT_REACHED();
}

ds_put_format(ds, "\nslave: %s: %s %s\n", slave->name, status,
Expand Down
22 changes: 11 additions & 11 deletions lib/meta-flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ mf_is_all_wild(const struct mf_field *mf, const struct flow_wildcards *wc)

case MFF_N_IDS:
default:
NOT_REACHED();
OVS_NOT_REACHED();
}
}

Expand Down Expand Up @@ -1016,7 +1016,7 @@ mf_is_mask_valid(const struct mf_field *mf, const union mf_value *mask)
return true;
}

NOT_REACHED();
OVS_NOT_REACHED();
}

static bool
Expand Down Expand Up @@ -1081,7 +1081,7 @@ mf_are_prereqs_ok(const struct mf_field *mf, const struct flow *flow)
&& (flow->tp_src == htons(ND_NEIGHBOR_ADVERT)));
}

NOT_REACHED();
OVS_NOT_REACHED();
}

/* Set field and it's prerequisities in the mask.
Expand Down Expand Up @@ -1220,7 +1220,7 @@ mf_is_value_valid(const struct mf_field *mf, const union mf_value *value)

case MFF_N_IDS:
default:
NOT_REACHED();
OVS_NOT_REACHED();
}
}

Expand Down Expand Up @@ -1411,7 +1411,7 @@ mf_get_value(const struct mf_field *mf, const struct flow *flow,

case MFF_N_IDS:
default:
NOT_REACHED();
OVS_NOT_REACHED();
}
}

Expand Down Expand Up @@ -1607,7 +1607,7 @@ mf_set_value(const struct mf_field *mf,

case MFF_N_IDS:
default:
NOT_REACHED();
OVS_NOT_REACHED();
}
}

Expand Down Expand Up @@ -1823,7 +1823,7 @@ mf_set_flow_value(const struct mf_field *mf,

case MFF_N_IDS:
default:
NOT_REACHED();
OVS_NOT_REACHED();
}
}

Expand Down Expand Up @@ -2031,7 +2031,7 @@ mf_set_wild(const struct mf_field *mf, struct match *match)

case MFF_N_IDS:
default:
NOT_REACHED();
OVS_NOT_REACHED();
}
}

Expand Down Expand Up @@ -2199,7 +2199,7 @@ mf_set(const struct mf_field *mf,

case MFF_N_IDS:
default:
NOT_REACHED();
OVS_NOT_REACHED();
}

return mf->usable_protocols_bitwise;
Expand Down Expand Up @@ -2673,7 +2673,7 @@ mf_parse(const struct mf_field *mf, const char *s,
break;

default:
NOT_REACHED();
OVS_NOT_REACHED();
}

if (!error && !mf_is_mask_valid(mf, mask)) {
Expand Down Expand Up @@ -2827,7 +2827,7 @@ mf_format(const struct mf_field *mf,
break;

default:
NOT_REACHED();
OVS_NOT_REACHED();
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/multipath.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ multipath_algorithm(uint32_t hash, enum nx_mp_algorithm algorithm,
return algorithm_iter_hash(hash, n_links, arg);
}

NOT_REACHED();
OVS_NOT_REACHED();
}

/* Parses 's_' as a set of arguments to the "multipath" action and initializes
Expand Down
4 changes: 2 additions & 2 deletions lib/netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ min_attr_len(enum nl_attr_type type)
case NL_A_STRING: return 1;
case NL_A_FLAG: return 0;
case NL_A_NESTED: return 0;
case N_NL_ATTR_TYPES: default: NOT_REACHED();
case N_NL_ATTR_TYPES: default: OVS_NOT_REACHED();
}
}

Expand All @@ -661,7 +661,7 @@ max_attr_len(enum nl_attr_type type)
case NL_A_STRING: return SIZE_MAX;
case NL_A_FLAG: return SIZE_MAX;
case NL_A_NESTED: return SIZE_MAX;
case N_NL_ATTR_TYPES: default: NOT_REACHED();
case N_NL_ATTR_TYPES: default: OVS_NOT_REACHED();
}
}

Expand Down
6 changes: 3 additions & 3 deletions lib/odp-execute.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ odp_execute_set_action(struct ofpbuf *packet, const struct nlattr *a,
case OVS_KEY_ATTR_TCP_FLAGS:
case __OVS_KEY_ATTR_MAX:
default:
NOT_REACHED();
OVS_NOT_REACHED();
}
}

Expand Down Expand Up @@ -170,7 +170,7 @@ odp_execute_sample(void *dp, struct ofpbuf *packet, struct flow *key,
case OVS_SAMPLE_ATTR_UNSPEC:
case __OVS_SAMPLE_ATTR_MAX:
default:
NOT_REACHED();
OVS_NOT_REACHED();
}
}

Expand Down Expand Up @@ -239,7 +239,7 @@ odp_execute_actions__(void *dp, struct ofpbuf *packet, struct flow *key,

case OVS_ACTION_ATTR_UNSPEC:
case __OVS_ACTION_ATTR_MAX:
NOT_REACHED();
OVS_NOT_REACHED();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/odp-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -3383,7 +3383,7 @@ commit_mpls_action(const struct flow *flow, struct flow *base,
break;
}
default:
NOT_REACHED();
OVS_NOT_REACHED();
}

base->dl_type = flow->dl_type;
Expand Down
Loading

0 comments on commit 428b2ed

Please sign in to comment.