Skip to content
Commit 652562e5 authored by Marc Kleine-Budde's avatar Marc Kleine-Budde
Browse files

can: length: can_fd_len2dlc(): simplify length calculcation



If the length paramter in len2dlc() exceeds the size of the len2dlc array, we
return 0xF. This is equal to the last 16 members of the array.

This patch removes these members from the array, uses ARRAY_SIZE() for the
length check, and returns CANFD_MAX_DLC (which is 0xf).

Reviewed-by: default avatarVincent Mailhol <mailhol.vincent@wanadoo.fr>
Link: https://lore.kernel.org/r/20210111141930.693847-9-mkl@pengutronix.de
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 1ea0a522
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment