]> git.ipfire.org Git - thirdparty/linux.git/commit
can: netlink: remove useless check in can_tdc_changelink()
authorVincent Mailhol <mailhol@kernel.org>
Tue, 23 Sep 2025 06:58:33 +0000 (15:58 +0900)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 24 Sep 2025 15:09:45 +0000 (17:09 +0200)
commit2b0a6930ae7c54ef401cd0a98ba194236ff8fbf7
treee848fd02742d2632610578354697ab24e6155185
parent45be26b7e35a70ac7c79341747bd596d83dee977
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>
drivers/net/can/dev/netlink.c