Skip to content

Commit b51218a

Browse files
rettichschnidifabiobaltieri
authored andcommitted
net: net_pkt: Fix conditional compilation
This aligns the conditional compilation logic with the one used for the prototype in net_pkt.h, avoids build errors due to a undefined reference to net_pkt_print_frags. Signed-off-by: Reto Schneider <[email protected]>
1 parent a66935a commit b51218a

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

subsys/net/ip/net_pkt.c

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -295,36 +295,6 @@ static inline int16_t get_frees(struct net_buf_pool *pool)
295295
return 0;
296296
#endif
297297
}
298-
#endif
299-
300-
#if CONFIG_NET_PKT_LOG_LEVEL >= LOG_LEVEL_DBG
301-
static inline const char *get_name(struct net_buf_pool *pool)
302-
{
303-
#if defined(CONFIG_NET_BUF_POOL_USAGE)
304-
return pool->name;
305-
#else
306-
return "?";
307-
#endif
308-
}
309-
310-
static inline int16_t get_size(struct net_buf_pool *pool)
311-
{
312-
#if defined(CONFIG_NET_BUF_POOL_USAGE)
313-
return pool->pool_size;
314-
#else
315-
return 0;
316-
#endif
317-
}
318-
319-
static inline const char *slab2str(struct k_mem_slab *slab)
320-
{
321-
return net_pkt_slab2str(slab);
322-
}
323-
324-
static inline const char *pool2str(struct net_buf_pool *pool)
325-
{
326-
return net_pkt_pool2str(pool);
327-
}
328298

329299
void net_pkt_print_frags(struct net_pkt *pkt)
330300
{
@@ -360,6 +330,36 @@ void net_pkt_print_frags(struct net_pkt *pkt)
360330
total, count * frag_size,
361331
count ? (total * 100) / (count * frag_size) : 0);
362332
}
333+
#endif
334+
335+
#if CONFIG_NET_PKT_LOG_LEVEL >= LOG_LEVEL_DBG
336+
static inline const char *get_name(struct net_buf_pool *pool)
337+
{
338+
#if defined(CONFIG_NET_BUF_POOL_USAGE)
339+
return pool->name;
340+
#else
341+
return "?";
342+
#endif
343+
}
344+
345+
static inline int16_t get_size(struct net_buf_pool *pool)
346+
{
347+
#if defined(CONFIG_NET_BUF_POOL_USAGE)
348+
return pool->pool_size;
349+
#else
350+
return 0;
351+
#endif
352+
}
353+
354+
static inline const char *slab2str(struct k_mem_slab *slab)
355+
{
356+
return net_pkt_slab2str(slab);
357+
}
358+
359+
static inline const char *pool2str(struct net_buf_pool *pool)
360+
{
361+
return net_pkt_pool2str(pool);
362+
}
363363
#endif /* CONFIG_NET_PKT_LOG_LEVEL >= LOG_LEVEL_DBG */
364364

365365
#if NET_LOG_LEVEL >= LOG_LEVEL_DBG

0 commit comments

Comments
 (0)