Skip to content

Commit 73315dd

Browse files
jukkarcfriedt
authored andcommitted
net: shell: stats: Fix undefined function call
If CONFIG_NET_STATISTICS_PER_INTERFACE is not set, then the net_shell_print_statistics_all() function was not found and the compilation was failing. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent 84dfded commit 73315dd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

subsys/net/lib/shell/stats.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -646,14 +646,14 @@ static void net_shell_print_statistics(struct net_if *iface, void *user_data)
646646

647647
print_net_pm_stats(sh, iface);
648648
}
649-
#endif /* CONFIG_NET_STATISTICS */
650649

651-
#if defined(CONFIG_NET_STATISTICS_PER_INTERFACE)
652650
static void net_shell_print_statistics_all(struct net_shell_user_data *data)
653651
{
654-
net_if_foreach(net_shell_print_statistics, data);
652+
if (IS_ENABLED(CONFIG_NET_STATISTICS_PER_INTERFACE)) {
653+
net_if_foreach(net_shell_print_statistics, data);
654+
}
655655
}
656-
#endif
656+
#endif /* CONFIG_NET_STATISTICS */
657657

658658
int cmd_net_stats_all(const struct shell *sh, size_t argc, char *argv[])
659659
{

0 commit comments

Comments
 (0)