All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: Jeff Garzik <jeff@garzik.org>
Cc: Kurt Roeckx <kurt@roeckx.be>,
	561843@bugs.debian.org, netdev <netdev@vger.kernel.org>
Subject: [PATCH] ethtool: Do not report link partner advertising flags if set to 0
Date: Sun, 20 Dec 2009 19:12:30 +0000	[thread overview]
Message-ID: <1261336350.25157.200.camel@localhost> (raw)

Only some drivers (and none before kernel version 2.6.31) currently
set these flags.  When the flags are equal to 0 and so we don't know
what the link partner advertised, don't report anything.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 ethtool.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/ethtool.c b/ethtool.c
index 10dfc80..298b690 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -948,7 +948,9 @@ static int dump_ecmd(struct ethtool_cmd *ep)
 
 	dump_supported(ep);
 	dump_advertised(ep, "Advertised", ep->advertising);
-	dump_advertised(ep, "Link partner advertised", ep->lp_advertising);
+	if (ep->lp_advertising)
+		dump_advertised(ep, "Link partner advertised",
+				ep->lp_advertising);
 
 	fprintf(stdout, "	Speed: ");
 	speed = ethtool_cmd_speed(ep);
-- 
1.6.5.7



             reply	other threads:[~2009-12-20 19:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-20 19:12 Ben Hutchings [this message]
2009-12-20 20:34 ` [PATCH] ethtool: Do not report link partner advertising flags if set to 0 Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1261336350.25157.200.camel@localhost \
    --to=ben@decadent.org.uk \
    --cc=561843@bugs.debian.org \
    --cc=jeff@garzik.org \
    --cc=kurt@roeckx.be \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.