diff mbox series

[ethtool] cable-test: TDR Amplitude is signed

Message ID 20200816152508.2285431-1-andrew@lunn.ch
State Accepted
Delegated to: Michal Kubecek
Headers show
Series [ethtool] cable-test: TDR Amplitude is signed | expand

Commit Message

Andrew Lunn Aug. 16, 2020, 3:25 p.m. UTC
Use the signed JSON helper for printing the TDR amplitude. Otherwise
negative values, i.e. cable shorts, become very large positive values.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 netlink/cable_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michal Kubecek Aug. 23, 2020, 4:04 p.m. UTC | #1
On Sun, Aug 16, 2020 at 05:25:08PM +0200, Andrew Lunn wrote:
> Use the signed JSON helper for printing the TDR amplitude. Otherwise
> negative values, i.e. cable shorts, become very large positive values.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>

Applied, thank you.

Michal

> ---
>  netlink/cable_test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/netlink/cable_test.c b/netlink/cable_test.c
> index d39b7d8..8a71453 100644
> --- a/netlink/cable_test.c
> +++ b/netlink/cable_test.c
> @@ -354,7 +354,7 @@ static int nl_cable_test_tdr_ntf_attr(struct nlattr *evattr)
>  
>  		open_json_object(NULL);
>  		print_string(PRINT_ANY, "pair", "%s ", nl_pair2txt(pair));
> -		print_uint(PRINT_ANY, "amplitude", "Amplitude %4d\n", mV);
> +		print_int(PRINT_ANY, "amplitude", "Amplitude %4d\n", mV);
>  		close_json_object();
>  		break;
>  	}
> -- 
> 2.27.0
>
diff mbox series

Patch

diff --git a/netlink/cable_test.c b/netlink/cable_test.c
index d39b7d8..8a71453 100644
--- a/netlink/cable_test.c
+++ b/netlink/cable_test.c
@@ -354,7 +354,7 @@  static int nl_cable_test_tdr_ntf_attr(struct nlattr *evattr)
 
 		open_json_object(NULL);
 		print_string(PRINT_ANY, "pair", "%s ", nl_pair2txt(pair));
-		print_uint(PRINT_ANY, "amplitude", "Amplitude %4d\n", mV);
+		print_int(PRINT_ANY, "amplitude", "Amplitude %4d\n", mV);
 		close_json_object();
 		break;
 	}