Re: [PATCH v5] can: usb: etas_es58X: add support for ETAS ES58X CAN USB interfaces

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

 



Hi Vincent,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.10-rc3 next-20201110]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Vincent-Mailhol/can-usb-etas_es58X-add-support-for-ETAS-ES58X-CAN-USB-interfaces/20201109-094004
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 521b619acdc8f1f5acdac15b84f81fd9515b2aff
config: i386-randconfig-a012-20201110 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/879dffec30f6576b5fdea872e5d3c71965f902ca
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Vincent-Mailhol/can-usb-etas_es58X-add-support-for-ETAS-ES58X-CAN-USB-interfaces/20201109-094004
        git checkout 879dffec30f6576b5fdea872e5d3c71965f902ca
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

   drivers/net/can/usb/etas_es58x/es58x_core.c: In function 'es58x_rx_can_msg':
   drivers/net/can/usb/etas_es58x/es58x_core.c:745:12: error: 'CAN_MAX_RAW_DLC' undeclared (first use in this function); did you mean 'CAN_MAX_DLC'?
     745 |  if (dlc > CAN_MAX_RAW_DLC) {
         |            ^~~~~~~~~~~~~~~
         |            CAN_MAX_DLC
   drivers/net/can/usb/etas_es58x/es58x_core.c:745:12: note: each undeclared identifier is reported only once for each function it appears in
   drivers/net/can/usb/etas_es58x/es58x_core.c:756:9: error: implicit declaration of function 'can_get_cc_len'; did you mean 'can_get_echo_skb'? [-Werror=implicit-function-declaration]
     756 |   len = can_get_cc_len(dlc);
         |         ^~~~~~~~~~~~~~
         |         can_get_echo_skb
   drivers/net/can/usb/etas_es58x/es58x_core.c:775:6: error: 'struct can_frame' has no member named 'len8_dlc'
     775 |   ccf->len8_dlc = can_get_len8_dlc(es58x_priv(netdev)->can.ctrlmode,
         |      ^~
>> drivers/net/can/usb/etas_es58x/es58x_core.c:775:19: error: implicit declaration of function 'can_get_len8_dlc'; did you mean 'can_len2dlc'? [-Werror=implicit-function-declaration]
     775 |   ccf->len8_dlc = can_get_len8_dlc(es58x_priv(netdev)->can.ctrlmode,
         |                   ^~~~~~~~~~~~~~~~
         |                   can_len2dlc
   cc1: some warnings being treated as errors
--
   drivers/net/can/usb/etas_es58x/es581_4.c: In function 'es581_4_tx_can_msg':
   drivers/net/can/usb/etas_es58x/es581_4.c:385:20: error: implicit declaration of function 'can_get_cc_dlc'; did you mean 'can_get_echo_skb'? [-Werror=implicit-function-declaration]
     385 |  tx_can_msg->dlc = can_get_cc_dlc(priv->can.ctrlmode,
         |                    ^~~~~~~~~~~~~~
         |                    can_get_echo_skb
>> drivers/net/can/usb/etas_es58x/es581_4.c:386:9: error: 'struct can_frame' has no member named 'len'
     386 |       cf->len, cf->len8_dlc);
         |         ^~
   drivers/net/can/usb/etas_es58x/es581_4.c:386:18: error: 'struct can_frame' has no member named 'len8_dlc'
     386 |       cf->len, cf->len8_dlc);
         |                  ^~
   In file included from arch/x86/include/asm/string.h:3,
                    from include/linux/string.h:20,
                    from include/linux/uuid.h:12,
                    from include/linux/mod_devicetable.h:13,
                    from include/linux/usb.h:5,
                    from drivers/net/can/usb/etas_es58x/es58x_core.h:16,
                    from drivers/net/can/usb/etas_es58x/es581_4.c:15:
   drivers/net/can/usb/etas_es58x/es581_4.c:388:39: error: 'struct can_frame' has no member named 'len'
     388 |  memcpy(tx_can_msg->data, cf->data, cf->len);
         |                                       ^~
   arch/x86/include/asm/string_32.h:182:48: note: in definition of macro 'memcpy'
     182 | #define memcpy(t, f, n) __builtin_memcpy(t, f, n)
         |                                                ^
   In file included from <command-line>:
   drivers/net/can/usb/etas_es58x/es581_4.c:30:29: error: implicit declaration of function 'can_get_cc_len'; did you mean 'can_get_echo_skb'? [-Werror=implicit-function-declaration]
      30 |  offsetof(typeof(msg), data[can_get_cc_len((msg).dlc)])
         |                             ^~~~~~~~~~~~~~
   include/linux/compiler_types.h:135:57: note: in definition of macro '__compiler_offsetof'
     135 | #define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
         |                                                         ^
   drivers/net/can/usb/etas_es58x/es581_4.c:30:2: note: in expansion of macro 'offsetof'
      30 |  offsetof(typeof(msg), data[can_get_cc_len((msg).dlc)])
         |  ^~~~~~~~
   drivers/net/can/usb/etas_es58x/es581_4.c:392:13: note: in expansion of macro 'es581_4_sizeof_rx_tx_msg'
     392 |  msg_len += es581_4_sizeof_rx_tx_msg(*tx_can_msg);
         |             ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/can/usb/etas_es58x/es581_4.c: At top level:
>> drivers/net/can/usb/etas_es58x/es581_4.c:517:30: error: 'CAN_CTRLMODE_CC_LEN8_DLC' undeclared here (not in a function); did you mean 'CAN_CTRLMODE_LISTENONLY'?
     517 |      CAN_CTRLMODE_LOOPBACK | CAN_CTRLMODE_CC_LEN8_DLC,
         |                              ^~~~~~~~~~~~~~~~~~~~~~~~
         |                              CAN_CTRLMODE_LISTENONLY
   cc1: some warnings being treated as errors
--
   drivers/net/can/usb/etas_es58x/es58x_fd.c: In function 'es58x_fd_rx_can_msg':
>> drivers/net/can/usb/etas_es58x/es58x_fd.c:36:3: error: implicit declaration of function 'can_get_cc_len'; did you mean 'can_get_echo_skb'? [-Werror=implicit-function-declaration]
      36 |   can_get_cc_len(__msg.dlc);    \
         |   ^~~~~~~~~~~~~~
   drivers/net/can/usb/etas_es58x/es58x_fd.c:119:24: note: in expansion of macro 'es58x_fd_sizeof_rx_tx_msg'
     119 |   u16 rx_can_msg_len = es58x_fd_sizeof_rx_tx_msg(*rx_can_msg);
         |                        ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/can/usb/etas_es58x/es58x_fd.c: In function 'es58x_fd_tx_can_msg':
   drivers/net/can/usb/etas_es58x/es58x_fd.c:371:23: error: 'struct can_frame' has no member named 'len'
     371 |   tx_can_msg->len = cf->len;
         |                       ^~
   drivers/net/can/usb/etas_es58x/es58x_fd.c:373:21: error: implicit declaration of function 'can_get_cc_dlc'; did you mean 'can_get_echo_skb'? [-Werror=implicit-function-declaration]
     373 |   tx_can_msg->dlc = can_get_cc_dlc(priv->can.ctrlmode,
         |                     ^~~~~~~~~~~~~~
         |                     can_get_echo_skb
   drivers/net/can/usb/etas_es58x/es58x_fd.c:374:10: error: 'struct can_frame' has no member named 'len'
     374 |        cf->len, cf->len8_dlc);
         |          ^~
   drivers/net/can/usb/etas_es58x/es58x_fd.c:374:19: error: 'struct can_frame' has no member named 'len8_dlc'
     374 |        cf->len, cf->len8_dlc);
         |                   ^~
   In file included from arch/x86/include/asm/string.h:3,
                    from include/linux/string.h:20,
                    from include/linux/uuid.h:12,
                    from include/linux/mod_devicetable.h:13,
                    from include/linux/usb.h:5,
                    from drivers/net/can/usb/etas_es58x/es58x_core.h:16,
                    from drivers/net/can/usb/etas_es58x/es58x_fd.c:17:
   drivers/net/can/usb/etas_es58x/es58x_fd.c:375:39: error: 'struct can_frame' has no member named 'len'
     375 |  memcpy(tx_can_msg->data, cf->data, cf->len);
         |                                       ^~
   arch/x86/include/asm/string_32.h:182:48: note: in definition of macro 'memcpy'
     182 | #define memcpy(t, f, n) __builtin_memcpy(t, f, n)
         |                                                ^
   drivers/net/can/usb/etas_es58x/es58x_fd.c: At top level:
   drivers/net/can/usb/etas_es58x/es58x_fd.c:618:6: error: 'CAN_CTRLMODE_CC_LEN8_DLC' undeclared here (not in a function); did you mean 'CAN_CTRLMODE_LISTENONLY'?
     618 |      CAN_CTRLMODE_CC_LEN8_DLC,
         |      ^~~~~~~~~~~~~~~~~~~~~~~~
         |      CAN_CTRLMODE_LISTENONLY
   cc1: some warnings being treated as errors

vim +775 drivers/net/can/usb/etas_es58x/es58x_core.c

   718	
   719	/**
   720	 * es58x_rx_can_msg() - Handle a received a CAN message.
   721	 * @netdev: CAN network device.
   722	 * @timestamp: Hardware time stamp (only relevant in rx branches).
   723	 * @data: CAN payload.
   724	 * @can_id: CAN ID.
   725	 * @es58x_flags: Please refer to enum es58x_flag.
   726	 * @dlc: Data Length Code (raw value).
   727	 *
   728	 * Fill up a CAN skb and post it.
   729	 *
   730	 * This function handles the case where the DLC of a classical CAN
   731	 * frame is greater than CAN_MAX_DLEN (c.f. the len8_dlc field of
   732	 * struct can_frame).
   733	 *
   734	 * Return: zero on success.
   735	 */
   736	int es58x_rx_can_msg(struct net_device *netdev, u64 timestamp, const u8 *data,
   737			     canid_t can_id, enum es58x_flag es58x_flags, u8 dlc)
   738	{
   739		struct canfd_frame *cfd;
   740		struct can_frame *ccf;
   741		struct sk_buff *skb;
   742		u8 len;
   743		bool is_can_fd = !!(es58x_flags & ES58X_FLAG_FD_DATA);
   744	
   745		if (dlc > CAN_MAX_RAW_DLC) {
   746			netdev_err(netdev,
   747				   "%s: DLC is %d but maximum should be %d\n",
   748				   __func__, dlc, CAN_MAX_RAW_DLC);
   749			return -EMSGSIZE;
   750		}
   751	
   752		if (is_can_fd) {
   753			len = can_dlc2len(dlc);
   754			skb = alloc_canfd_skb(netdev, &cfd);
   755		} else {
   756			len = can_get_cc_len(dlc);
   757			skb = alloc_can_skb(netdev, &ccf);
   758			cfd = (struct canfd_frame *)ccf;
   759		}
   760	
   761		if (!skb) {
   762			netdev->stats.rx_dropped++;
   763			return -ENOMEM;
   764		}
   765		cfd->can_id = can_id;
   766		cfd->len = len;
   767		if (es58x_flags & ES58X_FLAG_EFF)
   768			cfd->can_id |= CAN_EFF_FLAG;
   769		if (is_can_fd) {
   770			if (es58x_flags & ES58X_FLAG_FD_BRS)
   771				cfd->flags |= CANFD_BRS;
   772			if (es58x_flags & ES58X_FLAG_FD_ESI)
   773				cfd->flags |= CANFD_ESI;
   774		} else {
 > 775			ccf->len8_dlc = can_get_len8_dlc(es58x_priv(netdev)->can.ctrlmode,
   776							 len, dlc);
   777			if (es58x_flags & ES58X_FLAG_RTR) {
   778				ccf->can_id |= CAN_RTR_FLAG;
   779				len = 0;
   780			}
   781		}
   782		memcpy(cfd->data, data, len);
   783		netdev->stats.rx_packets++;
   784		netdev->stats.rx_bytes += len;
   785	
   786		es58x_set_skb_timestamp(netdev, skb, timestamp);
   787		netif_rx(skb);
   788	
   789		es58x_priv(netdev)->err_passive_before_rtx_success = 0;
   790	
   791		return 0;
   792	}
   793	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[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