Re: [PATCH v2] can: usb: IXXAT USB-to-CAN adapters drivers

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

 



Hello Florian,

already much better...

Am 25.06.2018 um 09:50 schrieb Florian Ferg:
> From: Florian Ferg <flfe@xxxxxxxxxxxxxxx>
> 
> This patch adds the driver for the IXXAT USB-to-CAN interfaces.
> There is an adapter for the older communication layer cl1 and another
> adapter for the newer communication layer cl2.
> 
> Signed-off-by: Florian Ferg <flfe@xxxxxxxxxxxxxxx>
> ---
> Fixed some style issues.
> Using ktime API for timestamps.
> Reworked the driver to be only one module with adapters for cl1 / cl2.
> CAN-IDM100 device will not be released. The driver handles CANIDM-101 now.
> Added error passive recognition. (Even though current devices don't
>         signal it. Future devices probably will.)
> 
>  drivers/net/can/usb/Kconfig                    |   17 +
>  drivers/net/can/usb/Makefile                   |    1 +
>  drivers/net/can/usb/ixxat_usb/Makefile         |    2 +
>  drivers/net/can/usb/ixxat_usb/ixxat_usb_cl1.c  |  425 ++++++++++
>  drivers/net/can/usb/ixxat_usb/ixxat_usb_cl2.c  |  581 +++++++++++++
>  drivers/net/can/usb/ixxat_usb/ixxat_usb_core.c | 1039 ++++++++++++++++++++++++
>  drivers/net/can/usb/ixxat_usb/ixxat_usb_core.h |  448 ++++++++++
>  7 files changed, 2513 insertions(+)
>  create mode 100644 drivers/net/can/usb/ixxat_usb/Makefile
>  create mode 100644 drivers/net/can/usb/ixxat_usb/ixxat_usb_cl1.c
>  create mode 100644 drivers/net/can/usb/ixxat_usb/ixxat_usb_cl2.c
>  create mode 100644 drivers/net/can/usb/ixxat_usb/ixxat_usb_core.c
>  create mode 100644 drivers/net/can/usb/ixxat_usb/ixxat_usb_core.h


... but there is still duplicated code. The following functions in
ixxat_usb_cl1.c and ixxat_usb_cl2.c are identical:

  ixxat_usb_handle_status()
  ixxat_usb_handle_error()

And almost identical are:

  ixxat_usb_handle_canmsg()
  ixxat_usb_decode_buf()
  ixxat_usb_encode_msg()

Could you move the netif and skb handling to the main part, at least...
Looking at:

  $ meld ixxat_usb_cl1.c ixxat_usb_cl2.c

I really wonder if you are not just done with a few

 if (priv->adapter == XYZ)

Wolfgang.
--
To unsubscribe from this list: send the line "unsubscribe linux-can" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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