Thread (39 messages) 39 messages, 6 authors, 2025-02-03

Re: [PATCH ethtool-next 09/14] qsfp: Add JSON output handling to --module-info in SFF8636 modules

From: Gal Pressman <hidden>
Date: 2025-01-29 11:37:34

On 29/01/2025 0:13, Jakub Kicinski wrote:
On Tue, 28 Jan 2025 13:23:42 +0000 Danielle Ratson wrote:
quoted
quoted
On Sun, 26 Jan 2025 13:56:30 +0200 Danielle Ratson wrote:  
quoted
+		open_json_object("extended_identifier");
+		print_int(PRINT_JSON, "value", "0x%02x",
+			  map->page_00h[SFF8636_EXT_ID_OFFSET]);  
Hm, why hex here?
Priority for JSON output is to make it easy to handle in code, rather than easy
to read. Hex strings need extra manual decoding, no?  
I kept the same convention as in the regular output.
And as agreed in Daniel's design those hex fields remain hex fields
and are followed by a description field.

Do you think otherwise?  
I have a weak preference to never use hex strings.
I have regretted using hex strings in JSON multiple times but haven't
regretted using plain integers, yet.
+1, jq won't be able to parse such json.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help