# 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 
- List: netdev
- Page: https://ratatoskr.run/netdev/2021/06/1416238
- Thread: https://ratatoskr.run/linux-can/2021/06/1401351/t.md

```text
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

- [signature.asc](https://ratatoskr.run/netdev/2021/06/1416238/attachment/0) (application/pgp-signature, 488 bytes)
