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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 |

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux