Skip to content

Commit 67e07b7

Browse files
thughesnashif
authored andcommitted
net: utils: Fix unused function warning
Building with clang warns: subsys/net/ip/utils.c:600:24: error: unused function 'pkt_calc_chksum' [-Werror,-Wunused-function] static inline uint16_t pkt_calc_chksum(struct net_pkt *pkt, uint16_t sum) ^ pkt_calc_chksum is called by net_calc_chksum, which only exists when CONFIG_NET_NATIVE_IP is defined. Signed-off-by: Tom Hughes <tomhughes@chromium.org>
1 parent 820aff1 commit 67e07b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subsys/net/ip/utils.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,7 @@ uint16_t calc_chksum(uint16_t sum_in, const uint8_t *data, size_t len)
636636
}
637637
}
638638

639+
#if defined(CONFIG_NET_NATIVE_IP)
639640
static inline uint16_t pkt_calc_chksum(struct net_pkt *pkt, uint16_t sum)
640641
{
641642
struct net_pkt_cursor *cur = &pkt->cursor;
@@ -673,7 +674,6 @@ static inline uint16_t pkt_calc_chksum(struct net_pkt *pkt, uint16_t sum)
673674
return sum;
674675
}
675676

676-
#if defined(CONFIG_NET_NATIVE_IP)
677677
uint16_t net_calc_chksum(struct net_pkt *pkt, uint8_t proto)
678678
{
679679
size_t len = 0U;

0 commit comments

Comments
 (0)