From 6e36351faf5b69a0bfb8235b3b06f8b2c24e5547 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Fri, 10 Aug 2018 22:39:11 +0200 Subject: Multiarch handling in different constructor macros This significantly reduces need for ... in multiarch code. Simply constructor macros will jost create static unused entry if CLIB_MARCH_VARIANT is defined and that will be optimized out by compiler. Change-Id: I17d1c4ac0c903adcfadaa4a07de1b854c7ab14ac Signed-off-by: Damjan Marion --- src/vnet/ip/ip4_input.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/vnet/ip') diff --git a/src/vnet/ip/ip4_input.c b/src/vnet/ip/ip4_input.c index d11d558eb93..1425786a4b1 100644 --- a/src/vnet/ip/ip4_input.c +++ b/src/vnet/ip/ip4_input.c @@ -47,7 +47,6 @@ typedef struct u8 packet_data[64]; } ip4_input_trace_t; -#ifndef CLIB_MARCH_VARIANT static u8 * format_ip4_input_trace (u8 * s, va_list * va) { @@ -60,7 +59,6 @@ format_ip4_input_trace (u8 * s, va_list * va) return s; } -#endif static_always_inline u32 ip4_input_set_next (u32 sw_if_index, vlib_buffer_t * b, int arc_enabled) @@ -312,6 +310,7 @@ char *ip4_error_strings[] = { foreach_ip4_error #undef _ }; +#endif /* *INDENT-OFF* */ VLIB_REGISTER_NODE (ip4_input_node) = { @@ -356,6 +355,7 @@ ip4_init (vlib_main_t * vm) hdlc_register_input_protocol (vm, HDLC_PROTOCOL_ip4, ip4_input_node.index); { + extern vlib_node_registration_t ip4_input_no_checksum_node; pg_node_t *pn; pn = pg_get_node (ip4_input_node.index); pn->unformat_edit = unformat_pg_ip4_header; @@ -405,8 +405,6 @@ ip4_main_loop_enter (vlib_main_t * vm) VLIB_MAIN_LOOP_ENTER_FUNCTION (ip4_main_loop_enter); -#endif - /* * fd.io coding-style-patch-verification: ON * -- cgit 1.2.3-korg