Re: [PATCH iproute2-next v4 03/11] lib: json_print: Add print_on_off()
From: Leon Romanovsky <leon@kernel.org>
Date: 2020-11-10 10:06:01
From: Leon Romanovsky <leon@kernel.org>
Date: 2020-11-10 10:06:01
On Sun, Nov 08, 2020 at 10:14:08PM +0100, Petr Machata wrote:
The value of a number of booleans is shown as "on" and "off" in the plain
output, and as an actual boolean in JSON mode. Add a function that does
that.
RDMA tool already uses a function named print_on_off(). This function
always shows "on" and "off", even in JSON mode. Since there are probably
very few if any consumers of this interface at this point, migrate it to
the new central print_on_off() as well.
Signed-off-by: Petr Machata <redacted>
---
Notes:
v3:
- Rename to print_on_off(). [David Ahern]
- Move over to json_print.c and make it a variant of print_bool().
Convert RDMA tool over to print_on_off(). [Leon Romanovsky]
include/json_print.h | 1 +
lib/json_print.c | 34 +++++++++++++++++++++++++++-------
rdma/dev.c | 2 +-
rdma/rdma.h | 1 -
rdma/res-cq.c | 2 +-
rdma/utils.c | 5 -----
6 files changed, 30 insertions(+), 15 deletions(-)Thanks, Reviewed-by: Leon Romanovsky <leonro@nvidia.com>