]> git.baikalelectronics.ru Git - kernel.git/commit
can: length: canfd_sanitize_len(): add function to sanitize CAN-FD data length
authorMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 11 Jan 2021 14:19:24 +0000 (15:19 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 14 Jan 2021 07:43:41 +0000 (08:43 +0100)
commitc2d702cc7e8749cb7c0ec9a1fdde30bb46e6a842
tree769fdd74658e90b5e090ddfb458f674c0deab913
parent0eb5e838ff31b3d9755dc498ae0bfbc6c1d133ee
can: length: canfd_sanitize_len(): add function to sanitize CAN-FD data length

The data field in CAN-FD frames have specifig frame length (0, 1, 2, 3, 4, 5,
6, 7, 8, 12, 16, 20, 24, 32, 48, 64). This function "rounds" up a given length
to the next valid CAN-FD frame length.

Reviewed-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Link: https://lore.kernel.org/r/20210111141930.693847-10-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
include/linux/can/length.h