Skip to content

Commit 1eea469

Browse files
BoughChenmarckleinebudde
authored andcommitted
can: dev: keep the max bitrate error at 5%
Commit b360a13 ("can: dev: print bitrate error with two decimal digits") changed calculation of the bit rate error from on-tenth of a percent to on-hundredth of a percent, but forgot to adjust the scale of the CAN_CALC_MAX_ERROR constant. Keeping the existing logic unchanged: Only when the bitrate error exceeds 5% should an error be returned. Otherwise, simply output a warning log. Fixes: b360a13 ("can: dev: print bitrate error with two decimal digits") Signed-off-by: Haibo Chen <haibo.chen@nxp.com> Link: https://patch.msgid.link/20260306-can-fix-v1-1-ac526cec6777@nxp.com Cc: stable@kernel.org [mkl: improve commit message] Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
1 parent e3f5e0f commit 1eea469

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/net/can/dev/calc_bittiming.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <linux/units.h>
99
#include <linux/can/dev.h>
1010

11-
#define CAN_CALC_MAX_ERROR 50 /* in one-tenth of a percent */
11+
#define CAN_CALC_MAX_ERROR 500 /* max error 5% */
1212

1313
/* CiA recommended sample points for Non Return to Zero encoding. */
1414
static int can_calc_sample_point_nrz(const struct can_bittiming *bt)

0 commit comments

Comments
 (0)