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: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Link: https://lore.kernel.org/r/20210111141930.693847-9-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Please register or sign in to comment