tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: d2901c3f0ff7d121adf97d64bd2cc3789821600d commit: db0908f0353219c48495233e71e676da2cefee44 [21243/22626] can: can controller driver for phytium CPUs config: arm64-randconfig-r122-20240531 (https://download.01.org/0day-ci/archive/20240601/202406010039.Hfpe41SX-lkp@i...) compiler: aarch64-linux-gcc (GCC) 13.2.0 reproduce: (https://download.01.org/0day-ci/archive/20240601/202406010039.Hfpe41SX-lkp@i...)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot lkp@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202406010039.Hfpe41SX-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
drivers/net/can/phytium/phytium_can.c:366:28: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int * @@
drivers/net/can/phytium/phytium_can.c:366:28: sparse: expected restricted __be32 const [usertype] *p drivers/net/can/phytium/phytium_can.c:366:28: sparse: got unsigned int * drivers/net/can/phytium/phytium_can.c:370:37: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int * @@ drivers/net/can/phytium/phytium_can.c:370:37: sparse: expected restricted __be32 const [usertype] *p drivers/net/can/phytium/phytium_can.c:370:37: sparse: got unsigned int *
drivers/net/can/phytium/phytium_can.c:436:51: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be32 [usertype] @@ got unsigned int @@
drivers/net/can/phytium/phytium_can.c:436:51: sparse: expected restricted __be32 [usertype] drivers/net/can/phytium/phytium_can.c:436:51: sparse: got unsigned int
drivers/net/can/phytium/phytium_can.c:568:31: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int @@ got restricted __be32 @@
drivers/net/can/phytium/phytium_can.c:568:31: sparse: expected unsigned int drivers/net/can/phytium/phytium_can.c:568:31: sparse: got restricted __be32 drivers/net/can/phytium/phytium_can.c:569:31: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int @@ got restricted __be32 @@ drivers/net/can/phytium/phytium_can.c:569:31: sparse: expected unsigned int drivers/net/can/phytium/phytium_can.c:569:31: sparse: got restricted __be32 drivers/net/can/phytium/phytium_can.c:601:31: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int @@ got restricted __be32 @@ drivers/net/can/phytium/phytium_can.c:601:31: sparse: expected unsigned int drivers/net/can/phytium/phytium_can.c:601:31: sparse: got restricted __be32
drivers/net/can/phytium/phytium_can.c:612:43: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected unsigned int [usertype] val @@ got restricted __be32 [usertype] @@
drivers/net/can/phytium/phytium_can.c:612:43: sparse: expected unsigned int [usertype] val drivers/net/can/phytium/phytium_can.c:612:43: sparse: got restricted __be32 [usertype] drivers/net/can/phytium/phytium_can.c:1050: warning: Function parameter or member 'skb' not described in 'phytium_can_start_xmit' drivers/net/can/phytium/phytium_can.c:1050: warning: Function parameter or member 'dev' not described in 'phytium_can_start_xmit'
vim +366 drivers/net/can/phytium/phytium_can.c
355 356 static int phytium_can_read_fifo(struct net_device *dev) 357 { 358 struct net_device_stats *stats = &dev->stats; 359 struct phytium_can_dev *cdev = netdev_priv(dev); 360 struct canfd_frame *cf; 361 struct sk_buff *skb; 362 u32 id, dlc, i; 363 364 /* Read the frame header from FIFO */ 365 id = phytium_can_read(cdev, CAN_RX_FIFO);
366 id = be32_to_cpup(&id);
367 if (id & CAN_IDE_MASK) { 368 /* Received an extended frame */ 369 dlc = phytium_can_read(cdev, CAN_RX_FIFO); 370 dlc = be32_to_cpup(&dlc); 371 if (dlc & CAN_ID2_FDF_MASK) 372 skb = alloc_canfd_skb(dev, &cf); 373 else 374 skb = alloc_can_skb(dev, (struct can_frame **)&cf); 375 376 if (unlikely(!skb)) { 377 stats->rx_dropped++; 378 return 0; 379 } 380 381 if (dlc & CAN_ID2_FDF_MASK) { 382 /* CAN FD extended frame */ 383 if (dlc & CANFD_ID2_BRS_MASK) 384 cf->flags |= CANFD_BRS; 385 if (dlc & CANFD_ID2_ESI_MASK) 386 cf->flags |= CANFD_ESI; 387 cf->len = can_dlc2len((dlc & CANFD_ID2_DLC_MASK) >> 388 CANFD_ID2_DLC_OFF); 389 } else { 390 /* CAN extended frame */ 391 cf->len = get_can_dlc((dlc & CAN_ID2_DLC_MASK) >> 392 CAN_ID2_DLC_OFF); 393 } 394 395 cf->can_id = (id & CAN_ID1_MASK) >> 3; 396 cf->can_id |= (id & CAN_ID2_MASK) >> 1; 397 cf->can_id |= CAN_EFF_FLAG; 398 399 if (id & CAN_ID2_RTR_MASK) 400 cf->can_id |= CAN_RTR_FLAG; 401 } else { 402 /* Received a standard frame */ 403 if (id & CAN_ID1_FDF_MASK) 404 skb = alloc_canfd_skb(dev, &cf); 405 else 406 skb = alloc_can_skb(dev, (struct can_frame **)&cf); 407 408 if (unlikely(!skb)) { 409 stats->rx_dropped++; 410 return 0; 411 } 412 413 if (id & CAN_ID1_FDF_MASK) { 414 /* CAN FD extended frame */ 415 if (id & CANFD_ID1_BRS_MASK) 416 cf->flags |= CANFD_BRS; 417 if (id & CANFD_ID1_ESI_MASK) 418 cf->flags |= CANFD_ESI; 419 cf->len = can_dlc2len((id & CANFD_ID1_DLC_MASK) >> 420 CANFD_ID1_DLC_OFF); 421 } else { 422 /* CAN extended frame */ 423 cf->len = get_can_dlc((id & CAN_ID1_DLC_MASK) >> 424 CAN_ID1_DLC_OFF); 425 } 426 427 cf->can_id = (id & CAN_ID1_MASK) >> 21; 428 429 if (id & CAN_ID1_RTR_MASK) 430 cf->can_id |= CAN_RTR_FLAG; 431 } 432 433 if (!(cf->can_id & CAN_RTR_FLAG)) 434 /* Receive data frames */ 435 for (i = 0; i < cf->len; i += 4)
436 *(__be32 *)(cf->data + i) = phytium_can_read(cdev,
437 CAN_RX_FIFO); 438 439 stats->rx_packets++; 440 stats->rx_bytes += cf->len; 441 netif_receive_skb(skb); 442 443 return 1; 444 } 445