Skip to content

Commit 2b0a693

Browse files
vincent-mailholmarckleinebudde
authored andcommitted
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>
1 parent 45be26b commit 2b0a693

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/can/dev/netlink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ static int can_tdc_changelink(struct can_priv *priv, const struct nlattr *nla,
180180
const struct can_tdc_const *tdc_const = priv->fd.tdc_const;
181181
int err;
182182

183-
if (!tdc_const || !can_fd_tdc_is_enabled(priv))
183+
if (!tdc_const)
184184
return -EOPNOTSUPP;
185185

186186
err = nla_parse_nested(tb_tdc, IFLA_CAN_TDC_MAX, nla,

0 commit comments

Comments
 (0)