[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250529142033.2308815-3-kuba@kernel.org>
Date: Thu, 29 May 2025 07:20:33 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: mkubecek@...e.cz
Cc: danieller@...dia.com,
idosch@...sch.org,
netdev@...r.kernel.org,
Jakub Kicinski <kuba@...nel.org>
Subject: [PATCH ethtool 2/2] module_common: print loss / fault signals as bool
JSON output is supposed to be easy to parse. We currently
output "Yes" / "No" for the per-lane signal loss / fault.
This forces user space to do string matching. Print bool.
Before:
"rx_loss_of_signal": ["No", "No", "No", "No"],
After:
"rx_loss_of_signal": [false, false, false, false],
Signed-off-by: Jakub Kicinski <kuba@...nel.org>
---
module-common.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/module-common.c b/module-common.c
index ae500c62af89..11b71bdb6281 100644
--- a/module-common.c
+++ b/module-common.c
@@ -317,8 +317,7 @@ void module_show_lane_status(const char *name, unsigned int lane_cnt,
open_json_array(json_fn, "");
while (lane_cnt--) {
- print_string(PRINT_JSON, NULL, "%s",
- value & 1 ? yes : no);
+ print_bool(PRINT_JSON, NULL, NULL, value & 1);
value >>= 1;
}
close_json_array("");
--
2.49.0
Powered by blists - more mailing lists