All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
To: Marc Kleine-Budde <mkl@pengutronix.de>, linux-can@vger.kernel.org
Cc: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Subject: [PATCH 2/2] can: netlink: clear tdc if fd is turned off
Date: Fri, 18 Jun 2021 17:19:04 +0900	[thread overview]
Message-ID: <20210618081904.141114-3-mailhol.vincent@wanadoo.fr> (raw)
In-Reply-To: <20210618081904.141114-1-mailhol.vincent@wanadoo.fr>

When the FD is turned off through the netlink interface, the value
still remain in struct can_tdc and are displayed despite of the
feature being disabled.

This patch clears priv->tdc whenever FD is set to off. This way, the
TDC variables are not displayed anymore.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
Hi Marc,

I would suggest to squash that into commit 5eb2cd8e2ded ("can:
netlink: add interface for CAN-FD Transmitter Delay Compensation
(TDC)").
---
 drivers/net/can/dev/netlink.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/can/dev/netlink.c b/drivers/net/can/dev/netlink.c
index b8d531e49540..b33e6da6ca5a 100644
--- a/drivers/net/can/dev/netlink.c
+++ b/drivers/net/can/dev/netlink.c
@@ -207,6 +207,7 @@ static int can_changelink(struct net_device *dev, struct nlattr *tb[],
 			dev->mtu = CAN_MTU;
 			memset(&priv->data_bittiming, 0,
 			       sizeof(priv->data_bittiming));
+			memset(&priv->tdc, 0, sizeof(priv->tdc));
 		}
 	}
 
-- 
2.31.1


  parent reply	other threads:[~2021-06-18  8:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18  8:19 [PATCH 0/2] Stop showing data bittiming if FD is turned off Vincent Mailhol
2021-06-18  8:19 ` [PATCH 1/2] can: netlink: clear data_bittiming if fd " Vincent Mailhol
2021-06-18  9:10   ` Marc Kleine-Budde
2021-06-18  9:58     ` Vincent MAILHOL
2021-06-18  8:19 ` Vincent Mailhol [this message]
2021-06-18  9:11   ` [PATCH 2/2] can: netlink: clear tdc " Marc Kleine-Budde

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=20210618081904.141114-3-mailhol.vincent@wanadoo.fr \
    --to=mailhol.vincent@wanadoo.fr \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    /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.