Skip to contentSkip to conversation

ethtool: Do not report link partner advertising flags if set to 0

PATCH Applied Ben Hutchings 2 participants 2 messages Dec 20, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ethtool: Do not report link partner advertising flags if set to 0

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.

---
 ethtool.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
ethtool.c +3 -1
index 10dfc80..298b690 100644
@@ -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);
Signature · 1 line
1.6.5.7
Applied
#1 lore raw
Quoted 8 lines · Ben Hutchings

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.

---
  ethtool.c |    4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)

applied