Re: [PATCH] can: gw: ensure DLC boundaries after CAN frame modification

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Michal,

On 1/4/19 10:01 AM, Michal Kubecek wrote:
On Thu, Jan 03, 2019 at 10:03:47PM +0100, Oliver Hartkopp wrote:
1. I'm still using the test "if (cf->can_dlc > 8)" with a proper comment as
CAN_MAX_DLC and CAN_MAX_DLEN are not defined in Linux stable 3.2 - so that
we can apply the patch to all versions of gw.c

I may be biased as substantial part of my work consists of trying to
understand unfamiliar code written by other people but I believe
readability of the code is more important than avoiding a bit of work
with backport to older stable branches.

I am with you.
Please take a look into the new patch. I think either the comment and the commit message make it very clear where the value comes from.

E.g. in cgw_chk_csum_parms() we have tons of fixed constants that have been introduced when CAN FD was far away from thinking. I introduced CAN_MAX_DLC and CAN_MAX_DLEN myself when I started the CAN FD support in Linux. gw.c would need a rework for full CAN FD support - where these defines then definitely would be introduced.

In this single case the simple applying to stable kernels weighted more to me.

Regards,
Oliver



[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux