Message ID | 1551355984-15752-4-git-send-email-ayal@mellanox.com |
---|---|
State | Accepted |
Delegated to: | David Ahern |
Headers | show |
Series | Add support for devlink health | expand |
diff --git a/devlink/devlink.c b/devlink/devlink.c index 8a28b5d5c26f..4b7e8ec2c88a 100644 --- a/devlink/devlink.c +++ b/devlink/devlink.c @@ -1628,10 +1628,10 @@ static void pr_out_str(struct dl *dl, const char *name, const char *val) static void pr_out_bool(struct dl *dl, const char *name, bool val) { - if (val) - pr_out_str(dl, name, "true"); + if (dl->json_output) + jsonw_bool_field(dl->jw, name, val); else - pr_out_str(dl, name, "false"); + pr_out_str(dl, name, val ? "true" : "false"); } static void pr_out_uint(struct dl *dl, const char *name, unsigned int val)