[mkl-can-next:testing 20/27] drivers/net/can/flexcan.c:1389:6: warning: variable 'err' set but not used

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git testing
head:   5974dc5581b5ae0ef7bef0916ec99663d4b78c9d
commit: cad1b206dc43c9324409af29a0d3eb6dc8fa6a02 [20/27] can: flexcan: flexcan_rx_offload_setup(): factor out mailbox and rx-offload setup into separate function
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git/commit/?id=cad1b206dc43c9324409af29a0d3eb6dc8fa6a02
        git remote add mkl-can-next https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git
        git fetch --no-tags mkl-can-next testing
        git checkout cad1b206dc43c9324409af29a0d3eb6dc8fa6a02
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=xtensa 

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

All warnings (new ones prefixed by >>):

   drivers/net/can/flexcan.c: In function 'flexcan_rx_offload_setup':
>> drivers/net/can/flexcan.c:1389:6: warning: variable 'err' set but not used [-Wunused-but-set-variable]
    1389 |  int err;
         |      ^~~

vim +/err +1389 drivers/net/can/flexcan.c

  1385	
  1386	static int flexcan_rx_offload_setup(struct net_device *dev)
  1387	{
  1388		struct flexcan_priv *priv = netdev_priv(dev);
> 1389		int err;
  1390	
  1391		if (priv->can.ctrlmode & CAN_CTRLMODE_FD)
  1392			priv->mb_size = sizeof(struct flexcan_mb) + CANFD_MAX_DLEN;
  1393		else
  1394			priv->mb_size = sizeof(struct flexcan_mb) + CAN_MAX_DLEN;
  1395		priv->mb_count = (sizeof(priv->regs->mb[0]) / priv->mb_size) +
  1396				 (sizeof(priv->regs->mb[1]) / priv->mb_size);
  1397	
  1398		if (priv->devtype_data->quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP)
  1399			priv->tx_mb_reserved =
  1400				flexcan_get_mb(priv, FLEXCAN_TX_MB_RESERVED_OFF_TIMESTAMP);
  1401		else
  1402			priv->tx_mb_reserved =
  1403				flexcan_get_mb(priv, FLEXCAN_TX_MB_RESERVED_OFF_FIFO);
  1404		priv->tx_mb_idx = priv->mb_count - 1;
  1405		priv->tx_mb = flexcan_get_mb(priv, priv->tx_mb_idx);
  1406		priv->tx_mask = FLEXCAN_IFLAG_MB(priv->tx_mb_idx);
  1407	
  1408		priv->offload.mailbox_read = flexcan_mailbox_read;
  1409	
  1410		if (priv->devtype_data->quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP) {
  1411			priv->offload.mb_first = FLEXCAN_RX_MB_OFF_TIMESTAMP_FIRST;
  1412			priv->offload.mb_last = priv->mb_count - 2;
  1413	
  1414			priv->rx_mask = GENMASK_ULL(priv->offload.mb_last,
  1415						    priv->offload.mb_first);
  1416			err = can_rx_offload_add_timestamp(dev, &priv->offload);
  1417		} else {
  1418			priv->rx_mask = FLEXCAN_IFLAG_RX_FIFO_OVERFLOW |
  1419				FLEXCAN_IFLAG_RX_FIFO_AVAILABLE;
  1420			err = can_rx_offload_add_fifo(dev, &priv->offload,
  1421						      FLEXCAN_NAPI_WEIGHT);
  1422		}
  1423	
  1424		return 0;
  1425	}
  1426	

---
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