Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

can: netlink: remove useless check in can_tdc_changelink()

can_tdc_changelink() return -EOPNOTSUPP under this condition:

!tdc_const || !can_fd_tdc_is_enabled(priv)

But this function is only called if the data[IFLA_CAN_TDC] parameters
are provided. At this point, can_validate_tdc() already checked that
either of the tdc auto or tdc manual control modes were provided, that
is to say, can_fd_tdc_is_enabled(priv) must be true.

Because the right hand operand of this condition is always true,
remove it.

Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
Link: https://patch.msgid.link/20250923-canxl-netlink-prep-v4-8-e720d28f66fe@kernel.org
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

authored by

Vincent Mailhol and committed by
Marc Kleine-Budde
2b0a6930 45be26b7

+1 -1
+1 -1
drivers/net/can/dev/netlink.c
··· 180 180 const struct can_tdc_const *tdc_const = priv->fd.tdc_const; 181 181 int err; 182 182 183 - if (!tdc_const || !can_fd_tdc_is_enabled(priv)) 183 + if (!tdc_const) 184 184 return -EOPNOTSUPP; 185 185 186 186 err = nla_parse_nested(tb_tdc, IFLA_CAN_TDC_MAX, nla,