Re: [net-next 09/17] can: length: can_fd_len2dlc(): simplify length calculcation

2021-01-14 Thread Vincent MAILHOL
On Fri. 15 Jan 2021 at 02:03, Oliver Hartkopp wrote: > On 14.01.21 10:16, Vincent MAILHOL wrote: > > On Tue. 14 Jan 2021 at 17:23, Oliver Hartkopp > > wrote: > >> On 14.01.21 02:59, Vincent MAILHOL wrote: > >>> On Tue. 14 Jan 2021 at 06:14, Marc Kleine-Budde > >>> wrote: > > If the l

Re: [net-next 09/17] can: length: can_fd_len2dlc(): simplify length calculcation

2021-01-14 Thread Oliver Hartkopp
On 14.01.21 10:16, Vincent MAILHOL wrote: On Tue. 14 Jan 2021 at 17:23, Oliver Hartkopp wrote: On 14.01.21 02:59, Vincent MAILHOL wrote: On Tue. 14 Jan 2021 at 06:14, Marc Kleine-Budde wrote: If the length paramter in len2dlc() exceeds the size of the len2dlc array, we return 0xF. This i

Re: [net-next 09/17] can: length: can_fd_len2dlc(): simplify length calculcation

2021-01-14 Thread Vincent MAILHOL
On Tue. 14 Jan 2021 at 17:23, Oliver Hartkopp wrote: > On 14.01.21 02:59, Vincent MAILHOL wrote: > > On Tue. 14 Jan 2021 at 06:14, Marc Kleine-Budde wrote: > >> > >> If the length paramter in len2dlc() exceeds the size of the len2dlc array, > >> we > >> return 0xF. This is equal to the last 16 m

Re: [net-next 09/17] can: length: can_fd_len2dlc(): simplify length calculcation

2021-01-14 Thread Oliver Hartkopp
On 14.01.21 02:59, Vincent MAILHOL wrote: On Tue. 14 Jan 2021 at 06:14, Marc Kleine-Budde wrote: 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, use

[net-next 09/17] can: length: can_fd_len2dlc(): simplify length calculcation

2021-01-14 Thread Marc Kleine-Budde
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 Mail

Re: [net-next 09/17] can: length: can_fd_len2dlc(): simplify length calculcation

2021-01-13 Thread Marc Kleine-Budde
On 1/14/21 2:59 AM, Vincent MAILHOL wrote: > On Tue. 14 Jan 2021 at 06:14, Marc Kleine-Budde wrote: >> >> 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

[net-next 09/17] can: length: can_fd_len2dlc(): simplify length calculcation

2021-01-13 Thread Marc Kleine-Budde
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 Mail

Re: [net-next 09/17] can: length: can_fd_len2dlc(): simplify length calculcation

2021-01-13 Thread Vincent MAILHOL
On Tue. 14 Jan 2021 at 06:14, Marc Kleine-Budde wrote: > > 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, a