From 2e2c60772703b7bc0f08585a0a4c6e0774bfcf1d Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Tue, 27 Feb 2018 18:01:18 +0800 Subject: [PATCH] =?UTF-8?q?lowpan6.c:=20Fix=20=E2=80=98lowpan6=5Fcontext?= =?UTF-8?q?=5Flookup=E2=80=99=20defined=20but=20not=20used=20build=20warni?= =?UTF-8?q?ng?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix build warning with LWIP_6LOWPAN_NUM_CONTEXTS==0. lowpan6_context_lookup() is only used when LWIP_6LOWPAN_IPHC && LWIP_6LOWPAN_NUM_CONTEXTS > 0. Signed-off-by: Axel Lin --- src/netif/lowpan6.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/netif/lowpan6.c b/src/netif/lowpan6.c index 31e8c56d..464e5bfb 100644 --- a/src/netif/lowpan6.c +++ b/src/netif/lowpan6.c @@ -146,11 +146,10 @@ dequeue_datagram(struct lowpan6_reass_helper *lrh) return ERR_OK; } -#if LWIP_6LOWPAN_IPHC +#if LWIP_6LOWPAN_IPHC && LWIP_6LOWPAN_NUM_CONTEXTS > 0 static s8_t lowpan6_context_lookup(const ip6_addr_t *ip6addr) { -#if LWIP_6LOWPAN_NUM_CONTEXTS > 0 s8_t i; for (i = 0; i < LWIP_6LOWPAN_NUM_CONTEXTS; i++) { @@ -158,12 +157,9 @@ lowpan6_context_lookup(const ip6_addr_t *ip6addr) return i; } } -#else - LWIP_UNUSED_ARG(ip6addr); -#endif return -1; } -#endif /* LWIP_6LOWPAN_IPHC */ +#endif /* LWIP_6LOWPAN_IPHC && LWIP_6LOWPAN_NUM_CONTEXTS > 0 */ #if LWIP_6LOWPAN_IPHC || LWIP_6LOWPAN_INFER_SHORT_ADDRESS /* Determine compression mode for unicast address. */