diff options
author | Damjan Marion <damarion@cisco.com> | 2015-12-18 10:26:56 +0100 |
---|---|---|
committer | Damjan Marion <damarion@cisco.com> | 2015-12-18 13:31:56 +0100 |
commit | 2c29d75021d684559146e656aac85f0c14ffb5ab (patch) | |
tree | f170a34ab269e94ab8c98ff77cd591e1f63157eb /vnet | |
parent | 5f1fd813c2773870ca92510c4e49a18810e9a4c8 (diff) |
Fix warnings/errors reported by clang
Change-Id: Ifb2de64347526e3218e22067452f249ff878fd32
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'vnet')
-rw-r--r-- | vnet/vnet/classify/input_acl.c | 2 | ||||
-rw-r--r-- | vnet/vnet/ethernet/arp.c | 2 | ||||
-rw-r--r-- | vnet/vnet/ip/icmp4.c | 2 | ||||
-rw-r--r-- | vnet/vnet/ip/icmp6.c | 2 | ||||
-rw-r--r-- | vnet/vnet/ip/ip4_hop_by_hop.c | 1 | ||||
-rw-r--r-- | vnet/vnet/ip/ip4_packet.h | 2 | ||||
-rw-r--r-- | vnet/vnet/ipsec/ipsec_output.c | 2 | ||||
-rw-r--r-- | vnet/vnet/l2tp/l2tp.c | 2 | ||||
-rw-r--r-- | vnet/vnet/map/ip4_map.c | 2 | ||||
-rw-r--r-- | vnet/vnet/map/ip6_map_t.c | 4 | ||||
-rw-r--r-- | vnet/vnet/policer/xlate.c | 4 | ||||
-rw-r--r-- | vnet/vnet/srp/node.c | 2 |
12 files changed, 12 insertions, 15 deletions
diff --git a/vnet/vnet/classify/input_acl.c b/vnet/vnet/classify/input_acl.c index 2c533d1170c..7e835a697f8 100644 --- a/vnet/vnet/classify/input_acl.c +++ b/vnet/vnet/classify/input_acl.c @@ -35,7 +35,7 @@ vnet_inacl_ip_feature_enable (vlib_main_t * vnm, { /* IP[46] */ ip_lookup_main_t * lm; ip_config_main_t * ipcm; - ip4_rx_feature_type_t ftype; + u32 ftype; u32 ci; if (tid == INPUT_ACL_TABLE_IP4) diff --git a/vnet/vnet/ethernet/arp.c b/vnet/vnet/ethernet/arp.c index 4f948407055..79ff44fd050 100644 --- a/vnet/vnet/ethernet/arp.c +++ b/vnet/vnet/ethernet/arp.c @@ -1746,7 +1746,7 @@ arp_term_l2bd (vlib_main_t * vm, ip0 = arp0->ip4_over_ethernet[1].ip4.as_u32; bd_index0 = vnet_buffer(p0)->l2.bd_index; if (PREDICT_FALSE ( - (bd_index0 != last_bd_index) || (last_bd_index == ~0))) + (bd_index0 != last_bd_index) || (last_bd_index == (u16) ~0))) { last_bd_index = bd_index0; last_bd_config = vec_elt_at_index(l2im->bd_configs, bd_index0); diff --git a/vnet/vnet/ip/icmp4.c b/vnet/vnet/ip/icmp4.c index e21f3bf047b..4ee8f15df1f 100644 --- a/vnet/vnet/ip/icmp4.c +++ b/vnet/vnet/ip/icmp4.c @@ -690,7 +690,7 @@ void ip4_icmp_register_type (vlib_main_t * vm, icmp4_type_t type, { icmp4_main_t * im = &icmp4_main; - ASSERT (type < ARRAY_LEN (im->ip4_input_next_index_by_type)); + ASSERT ((int)type < ARRAY_LEN (im->ip4_input_next_index_by_type)); im->ip4_input_next_index_by_type[type] = vlib_node_add_next (vm, ip4_icmp_input_node.index, node_index); } diff --git a/vnet/vnet/ip/icmp6.c b/vnet/vnet/ip/icmp6.c index 2d265d2b5b2..4e4bb8ece81 100644 --- a/vnet/vnet/ip/icmp6.c +++ b/vnet/vnet/ip/icmp6.c @@ -749,7 +749,7 @@ void icmp6_register_type (vlib_main_t * vm, icmp6_type_t type, u32 node_index) { icmp6_main_t * im = &icmp6_main; - ASSERT (type < ARRAY_LEN (im->input_next_index_by_type)); + ASSERT ((int) type < ARRAY_LEN (im->input_next_index_by_type)); im->input_next_index_by_type[type] = vlib_node_add_next (vm, ip6_icmp_input_node.index, node_index); } diff --git a/vnet/vnet/ip/ip4_hop_by_hop.c b/vnet/vnet/ip/ip4_hop_by_hop.c index ee2bcc0ae75..db6a50f271f 100644 --- a/vnet/vnet/ip/ip4_hop_by_hop.c +++ b/vnet/vnet/ip/ip4_hop_by_hop.c @@ -299,7 +299,6 @@ VLIB_REGISTER_NODE (ip4_pop_hop_by_hop_node) = { [IP_LOOKUP_NEXT_MAP] = "ip4-map", [IP_LOOKUP_NEXT_MAP_T] = "ip4-map-t", [IP_LOOKUP_NEXT_SIXRD] = "ip4-sixrd", - [IP_LOOKUP_NEXT_SIXRD] = "ip4-sixrd", [IP_LOOKUP_NEXT_HOP_BY_HOP] = "ip4-hop-by-hop", /* probably not */ [IP_LOOKUP_NEXT_ADD_HOP_BY_HOP] = "ip4-add-hop-by-hop", [IP_LOOKUP_NEXT_POP_HOP_BY_HOP] = "ip4-pop-hop-by-hop", diff --git a/vnet/vnet/ip/ip4_packet.h b/vnet/vnet/ip/ip4_packet.h index 69467eb4e03..ba00eedbb74 100644 --- a/vnet/vnet/ip/ip4_packet.h +++ b/vnet/vnet/ip/ip4_packet.h @@ -266,7 +266,7 @@ ip4_address_is_multicast (ip4_address_t * a) always_inline void ip4_multicast_address_set_for_group (ip4_address_t * a, ip_multicast_group_t g) { - ASSERT (g < (1 << 28)); + ASSERT ((u32) g < (1 << 28)); a->as_u32 = clib_host_to_net_u32 ((0xe << 28) + g); } diff --git a/vnet/vnet/ipsec/ipsec_output.c b/vnet/vnet/ipsec/ipsec_output.c index 77b39fa9ee4..ac5968b906d 100644 --- a/vnet/vnet/ipsec/ipsec_output.c +++ b/vnet/vnet/ipsec/ipsec_output.c @@ -81,7 +81,7 @@ static u8 * format_ipsec_output_trace (u8 * s, va_list * args) return s; } -always_inline intf_output_feat_t +always_inline intf_output_feat_t __attribute__((unused)) get_next_intf_output_feature_and_reset_bit(vlib_buffer_t *b) { u32 next_feature; diff --git a/vnet/vnet/l2tp/l2tp.c b/vnet/vnet/l2tp/l2tp.c index da28487dd7f..36567f96ea7 100644 --- a/vnet/vnet/l2tp/l2tp.c +++ b/vnet/vnet/l2tp/l2tp.c @@ -576,7 +576,7 @@ int l2tpv3_interface_enable_disable (vnet_main_t * vnm, ip_config_main_t * rx_cm = &lm->rx_config_mains[VNET_UNICAST]; u32 ci; ip6_l2tpv3_config_t config; - ip4_rx_feature_type_t type; + ip6_rx_feature_type_t type; if (pool_is_free_index (vnm->interface_main.sw_interfaces, sw_if_index)) return VNET_API_ERROR_INVALID_SW_IF_INDEX; diff --git a/vnet/vnet/map/ip4_map.c b/vnet/vnet/map/ip4_map.c index cf53ef4918c..559275eb586 100644 --- a/vnet/vnet/map/ip4_map.c +++ b/vnet/vnet/map/ip4_map.c @@ -130,7 +130,7 @@ ip4_map_vtcfl (ip4_header_t *ip4, vlib_buffer_t *p) u8 tc = mm->tc_copy ? ip4->tos : mm->tc; u32 vtcfl = 0x6 << 28; vtcfl |= tc << 20; - vtcfl |= vnet_buffer(p)->ip.flow_hash && 0x000fffff; + vtcfl |= vnet_buffer(p)->ip.flow_hash & 0x000fffff; return (clib_host_to_net_u32(vtcfl)); } diff --git a/vnet/vnet/map/ip6_map_t.c b/vnet/vnet/map/ip6_map_t.c index 7720e06fba4..b2c102ac3e7 100644 --- a/vnet/vnet/map/ip6_map_t.c +++ b/vnet/vnet/map/ip6_map_t.c @@ -451,7 +451,7 @@ ip6_map_t_fragmented (vlib_main_t *vm, u16 frag_id0, frag_offset0, frag_id1, frag_offset1; u8 frag_more0, frag_more1; - ip6_mapt_fragmented_next_t next0, next1; + u32 next0, next1; pi0 = to_next[0] = from[0]; pi1 = to_next[1] = from[1]; @@ -536,7 +536,7 @@ ip6_map_t_fragmented (vlib_main_t *vm, u16 frag_id0; u8 frag_more0; u16 frag_offset0; - ip6_mapt_fragmented_next_t next0; + u32 next0; pi0 = to_next[0] = from[0]; from += 1; diff --git a/vnet/vnet/policer/xlate.c b/vnet/vnet/policer/xlate.c index 761e8214413..6e8c324a5d3 100644 --- a/vnet/vnet/policer/xlate.c +++ b/vnet/vnet/policer/xlate.c @@ -894,7 +894,7 @@ compute_policer_params (uint64_t hz, // CPU speed in clocks per uint32_t max; uint32_t scale_shift; uint32_t scale_amount; - uint32_t orig_current_limit = *current_limit; + uint32_t __attribute__((unused)) orig_current_limit = *current_limit; // Compute period. For 1Ghz-to-8Ghz CPUs, the period will be in // the range of 16 to 116 usec. @@ -969,8 +969,6 @@ compute_policer_params (uint64_t hz, // CPU speed in clocks per (unsigned long long)effective_BPS, (double)cir_rate / (double)effective_BPS); } -#else - orig_current_limit = orig_current_limit; // Make compiler happy #endif return 0; // ok diff --git a/vnet/vnet/srp/node.c b/vnet/vnet/srp/node.c index a44f108326e..42143ef6e9d 100644 --- a/vnet/vnet/srp/node.c +++ b/vnet/vnet/srp/node.c @@ -703,7 +703,7 @@ static int requests_switch (srp_ips_request_type_t r) [SRP_IPS_REQUEST_signal_fail] = 1, [SRP_IPS_REQUEST_signal_degrade] = 1, }; - return r < ARRAY_LEN (t) ? t[r] : 0; + return (int) r < ARRAY_LEN (t) ? t[r] : 0; } /* Called when an IPS control packet is received on given interface. */ |