Skip to content

Commit

Permalink
net: utils: Fix unused function warning
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
thughes authored and nashif committed Feb 9, 2025
1 parent 820aff1 commit 67e07b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion subsys/net/ip/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ uint16_t calc_chksum(uint16_t sum_in, const uint8_t *data, size_t len)
}
}

#if defined(CONFIG_NET_NATIVE_IP)
static inline uint16_t pkt_calc_chksum(struct net_pkt *pkt, uint16_t sum)
{
struct net_pkt_cursor *cur = &pkt->cursor;
Expand Down Expand Up @@ -673,7 +674,6 @@ static inline uint16_t pkt_calc_chksum(struct net_pkt *pkt, uint16_t sum)
return sum;
}

#if defined(CONFIG_NET_NATIVE_IP)
uint16_t net_calc_chksum(struct net_pkt *pkt, uint8_t proto)
{
size_t len = 0U;
Expand Down

0 comments on commit 67e07b7

Please sign in to comment.