Skip to content

Commit

Permalink
sparse: eliminate "duplicate initialization" warning
Browse files Browse the repository at this point in the history
Sparse version 0.5.1 will be released in the near future. Prepare
for it by eliminating the only new warning (as of 0.5.1-rc5):

ofproto/fail-open.c:134:22: error: Initializer entry defined twice
ofproto/fail-open.c:135:22:   also defined here

MATCH_CATCHALL_INITIALIZER effectively sets all fields of .flow to
zero, which is redundant because according to the C99 semantics for
structure initialization, initializing any single member of a
structure results in all other members being initialized to zero,
and the next line initializes a member of the same structure.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
  • Loading branch information
hlrichardson authored and blp committed Oct 30, 2017
1 parent 33cac6d commit af2e40c
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion ofproto/fail-open.c
Expand Up @@ -131,7 +131,6 @@ send_bogus_packet_ins(struct fail_open *fo)
.base = {
.packet = dp_packet_data(&b),
.packet_len = dp_packet_size(&b),
.flow_metadata = MATCH_CATCHALL_INITIALIZER,
.flow_metadata.flow.in_port.ofp_port = OFPP_LOCAL,
.flow_metadata.wc.masks.in_port.ofp_port
= u16_to_ofp(UINT16_MAX),
Expand Down

0 comments on commit af2e40c

Please sign in to comment.