tools: ynl: add ynl_dump_empty() helper
authorJakub Kicinski <kuba@kernel.org>
Fri, 29 Mar 2024 18:16:51 +0000 (11:16 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 3 Apr 2024 01:01:58 +0000 (18:01 -0700)
commitd6d647d7ba6413148c3db2d48640986c8c1d7d08
tree6da345e3cdb8dc53f5d90bed51971a2028dfbe93
parentd88cabfd9abcd01c7729e5383919357da732ada9
tools: ynl: add ynl_dump_empty() helper

Checking if dump is empty requires a couple of casts.
Add a convenient wrapper.

Add an example use in the netdev sample, loopback is always
present so an empty dump is an error.

Reviewed-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Link: https://lore.kernel.org/r/20240329181651.319326-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/net/ynl/lib/ynl.h
tools/net/ynl/samples/netdev.c