Thread (20 messages) 20 messages, 3 authors, 2021-06-22

Re: [PATCH v2 2/2] can: netlink: add interface for CAN-FD Transmitter Delay Compensation (TDC)

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: 2021-06-16 09:46:40
Also in: linux-can, lkml

On 04.06.2021 00:15:50, Vincent Mailhol wrote:
[...]
+static size_t can_tdc_get_size(const struct net_device *dev)
+{
+	struct can_priv *priv = netdev_priv(dev);
+	size_t size;
+
+	if (!priv->tdc_const)
+		return 0;
+
+	size = nla_total_size(0);			/* nest IFLA_CAN_TDC */
+	size += nla_total_size(sizeof(u32));		/* IFLA_CAN_TDCV_MAX */
+	size += nla_total_size(sizeof(u32));		/* IFLA_CAN_TDCO_MAX */
+	size += nla_total_size(sizeof(u32));		/* IFLA_CAN_TDCF_MAX */
+
+	if (priv->tdc.tdco) {
Naively I'd say, iff the device has tdc_const give the user space the
tdc parameters, regardless if some value is 0 or not.

What do you think?

Marc
-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help