From 5b9f79680c9adfdc360e015e98c86cad5ad541c9 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Sat, 9 Dec 2017 09:45:08 +0800 Subject: [PATCH] lowpan6: Fix build warning when LWIP_6LOWPAN_IPHC=0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix below build warning if LWIP_6LOWPAN_IPHC=0. ../../../../lwip/src/netif/lowpan6.c:186:1: error: ‘lowpan6_get_address_mode_mc’ defined but not used [-Werror=unused-function] lowpan6_get_address_mode_mc(const ip6_addr_t *ip6addr) ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../../lwip/src/netif/lowpan6.c:160:1: error: ‘lowpan6_get_address_mode’ defined but not used [-Werror=unused-function] lowpan6_get_address_mode(const ip6_addr_t *ip6addr, const struct ieee_802154_addr *mac_addr) ^~~~~~~~~~~~~~~~~~~~~~~~ Also correct comment typo: s/LWIP_6LOWPAN_HC/LWIP_6LOWPAN_IPHC/g Signed-off-by: Axel Lin --- src/netif/lowpan6.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/netif/lowpan6.c b/src/netif/lowpan6.c index e7bfc657..db786caa 100644 --- a/src/netif/lowpan6.c +++ b/src/netif/lowpan6.c @@ -139,6 +139,7 @@ dequeue_datagram(struct lowpan6_reass_helper *lrh) return ERR_OK; } +#if LWIP_6LOWPAN_IPHC static s8_t lowpan6_context_lookup(const ip6_addr_t *ip6addr) { @@ -152,7 +153,9 @@ lowpan6_context_lookup(const ip6_addr_t *ip6addr) return -1; } +#endif /* LWIP_6LOWPAN_IPHC */ +#if LWIP_6LOWPAN_IPHC || LWIP_6LOWPAN_INFER_SHORT_ADDRESS /* Determine compression mode for unicast address. */ static s8_t lowpan6_get_address_mode(const ip6_addr_t *ip6addr, const struct ieee_802154_addr *mac_addr) @@ -178,7 +181,9 @@ lowpan6_get_address_mode(const ip6_addr_t *ip6addr, const struct ieee_802154_add return 1; } +#endif /* LWIP_6LOWPAN_IPHC || LWIP_6LOWPAN_INFER_SHORT_ADDRESS */ +#if LWIP_6LOWPAN_IPHC /* Determine compression mode for multicast address. */ static s8_t lowpan6_get_address_mode_mc(const ip6_addr_t *ip6addr) @@ -200,6 +205,7 @@ lowpan6_get_address_mode_mc(const ip6_addr_t *ip6addr) return 0; } +#endif /* LWIP_6LOWPAN_IPHC */ /* * Encapsulates data into IEEE 802.15.4 frames. @@ -456,11 +462,11 @@ lowpan6_frag(struct netif *netif, struct pbuf *p, const struct ieee_802154_addr #endif /* LWIP_UDP */ } -#else /* LWIP_6LOWPAN_HC */ +#else /* LWIP_6LOWPAN_IPHC */ /* Send uncompressed IPv6 header with appropriate dispatch byte. */ lowpan6_header_len = 1; buffer[ieee_header_len] = 0x41; /* IPv6 dispatch */ -#endif /* LWIP_6LOWPAN_HC */ +#endif /* LWIP_6LOWPAN_IPHC */ /* Calculate remaining packet length */ remaining_len = p->tot_len;