On 10.11.20 08:46, Marc Kleine-Budde wrote:
On 11/10/20 7:55 AM, Oliver Hartkopp wrote:

I would suggest something like

u8 can_get_cc_len(const u32 ctrlmode, struct can_frame *cf, u8 dlc)

that still returns the 'len' element, so that we can replace
can_cc_dlc2len() with can_get_cc_len() for CAN drivers that add support
for len8_dlc.

The regex to replace can_cc_dlc2len() with can_get_cc_len() might be simpler,
but passing the cf by reference _and_ assigning the return value to a member of
cf looks strange.

This might be a "make the patch looking good" thing too :-D

The code is now implemented even simpler and easy to follow when we migrate the other CAN drivers too.

But take a look on yourself. v6 is sent out.

Thanks,
Oliver

Reply via email to