From patchwork Sun Aug 16 15:25:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Lunn X-Patchwork-Id: 1345481 X-Patchwork-Delegate: mkubecek@suse.cz Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lunn.ch Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4BV1GM2Zmlz9sTR for ; Mon, 17 Aug 2020 01:25:47 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729192AbgHPPZp (ORCPT ); Sun, 16 Aug 2020 11:25:45 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:55206 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728346AbgHPPZl (ORCPT ); Sun, 16 Aug 2020 11:25:41 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1k7KXT-009aYe-TB; Sun, 16 Aug 2020 17:25:39 +0200 From: Andrew Lunn To: Michal Kubecek Cc: netdev , Andrew Lunn Subject: [PATCH ethtool] cable-test: TDR Amplitude is signed Date: Sun, 16 Aug 2020 17:25:08 +0200 Message-Id: <20200816152508.2285431-1-andrew@lunn.ch> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- 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; }