All of lore.kernel.org
 help / color / mirror / Atom feed
From: bage@linutronix.de
To: Michal Kubecek <mkubecek@suse.cz>
Cc: netdev@vger.kernel.org, Bastian Germann <bage@linutronix.de>
Subject: [PATCH ethtool 1/2] netlink: settings: Correct duplicate condition
Date: Wed, 27 Oct 2021 20:11:39 +0200	[thread overview]
Message-ID: <20211027181140.46971-2-bage@linutronix.de> (raw)
In-Reply-To: <20211027181140.46971-1-bage@linutronix.de>

From: Bastian Germann <bage@linutronix.de>

tb's fields ETHTOOL_A_LINKINFO_TP_MDIX and ETHTOOL_A_LINKINFO_TP_MDIX_CTRL
are used in this case. The condition is duplicate for the former. Fix that.

Signed-off-by: Bastian Germann <bage@linutronix.de>
---
 netlink/settings.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/netlink/settings.c b/netlink/settings.c
index 6d10a07..c4f5d61 100644
--- a/netlink/settings.c
+++ b/netlink/settings.c
@@ -560,7 +560,7 @@ int linkinfo_reply_cb(const struct nlmsghdr *nlhdr, void *data)
 		print_enum(names_transceiver, ARRAY_SIZE(names_transceiver),
 			   val, "Transceiver");
 	}
-	if (tb[ETHTOOL_A_LINKINFO_TP_MDIX] && tb[ETHTOOL_A_LINKINFO_TP_MDIX] &&
+	if (tb[ETHTOOL_A_LINKINFO_TP_MDIX] && tb[ETHTOOL_A_LINKINFO_TP_MDIX_CTRL] &&
 	    port == PORT_TP) {
 		uint8_t mdix = mnl_attr_get_u8(tb[ETHTOOL_A_LINKINFO_TP_MDIX]);
 		uint8_t mdix_ctrl =
-- 
2.30.2


  reply	other threads:[~2021-10-27 18:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-27 18:11 [PATCH ethtool 0/2] Fix condition for showing MDI-X status bage
2021-10-27 18:11 ` bage [this message]
2021-10-27 20:13   ` [PATCH ethtool 1/2] netlink: settings: Correct duplicate condition Michal Kubecek
2021-10-27 18:11 ` [PATCH ethtool 2/2] netlink: settings: Drop port filter for MDI-X bage
2021-10-27 19:59   ` Michal Kubecek
2021-10-27 20:17     ` Michal Kubecek
2021-10-28 15:30 ` [PATCH ethtool 0/2] Fix condition for showing MDI-X status Andrew Lunn

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=20211027181140.46971-2-bage@linutronix.de \
    --to=bage@linutronix.de \
    --cc=mkubecek@suse.cz \
    --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.