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: bittiming: apply NL_SET_ERR_MSG() to can_calc_bittiming()

When CONFIG_CAN_CALC_BITTIMING is disabled, the can_calc_bittiming()
functions can not be used and the user needs to provide all the
bittiming parameters.

Currently, can_calc_bittiming() prints an error message to the kernel
log. Instead use NL_SET_ERR_MSG() to make it return the error message
through the netlink interface so that the user can directly see it.

Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://patch.msgid.link/20251126-canxl-v8-2-e7e3eb74f889@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

authored by

Vincent Mailhol and committed by
Marc Kleine-Budde
585a4f22 66e75b27

+1 -1
+1 -1
include/linux/can/bittiming.h
··· 141 141 can_calc_bittiming(const struct net_device *dev, struct can_bittiming *bt, 142 142 const struct can_bittiming_const *btc, struct netlink_ext_ack *extack) 143 143 { 144 - netdev_err(dev, "bit-timing calculation not available\n"); 144 + NL_SET_ERR_MSG(extack, "bit-timing calculation not available\n"); 145 145 return -EINVAL; 146 146 } 147 147