[xilinx-xlnx:xlnx_rebase_v5.15_LTS_2022.1_update 216/1117] drivers/net/ethernet/xilinx/xilinx_axienet_main.c:690:31: warning: cast to pointer from integer of different size

kernel test robot lkp at intel.com
Wed Aug 24 04:57:47 PDT 2022


Hi Appana,

FYI, the error/warning still remains.

tree:   https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.15_LTS_2022.1_update
head:   789b01147d793e5a6d1c794dd0a5879ccd61bd1d
commit: bf05571deda79b6b79d0e5cd93dd813a7696fa79 [216/1117] net: axienet: Add support for 1588
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20220824/202208241944.x9hi9hUo-lkp@intel.com/config)
compiler: arceb-elf-gcc (GCC) 12.1.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://github.com/Xilinx/linux-xlnx/commit/bf05571deda79b6b79d0e5cd93dd813a7696fa79
        git remote add xilinx-xlnx https://github.com/Xilinx/linux-xlnx
        git fetch --no-tags xilinx-xlnx xlnx_rebase_v5.15_LTS_2022.1_update
        git checkout bf05571deda79b6b79d0e5cd93dd813a7696fa79
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arc SHELL=/bin/bash drivers/gpu/drm/xlnx/ drivers/net/ethernet/xilinx/ drivers/staging/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp at intel.com>

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/xilinx/xilinx_axienet_main.c: In function 'axienet_tx_hwtstamp':
>> drivers/net/ethernet/xilinx/xilinx_axienet_main.c:690:31: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     690 |                 skb_hwtstamps((struct sk_buff *)cur_p->ptp_tx_skb);
         |                               ^
   drivers/net/ethernet/xilinx/xilinx_axienet_main.c:743:26: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     743 |                 skb_pull((struct sk_buff *)cur_p->ptp_tx_skb,
         |                          ^
   drivers/net/ethernet/xilinx/xilinx_axienet_main.c:746:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     746 |         skb_tstamp_tx((struct sk_buff *)cur_p->ptp_tx_skb, shhwtstamps);
         |                       ^
   drivers/net/ethernet/xilinx/xilinx_axienet_main.c:747:27: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     747 |         dev_kfree_skb_any((struct sk_buff *)cur_p->ptp_tx_skb);
         |                           ^
   drivers/net/ethernet/xilinx/xilinx_axienet_main.c: In function 'axienet_start_xmit':
>> drivers/net/ethernet/xilinx/xilinx_axienet_main.c:1066:53: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    1066 |                                 cur_p->ptp_tx_skb = (phys_addr_t)skb_get(skb);
         |                                                     ^
   drivers/net/ethernet/xilinx/xilinx_axienet_main.c:1137:25: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    1137 |         cur_p->tx_skb = (phys_addr_t)skb;
         |                         ^
   drivers/net/ethernet/xilinx/xilinx_axienet_main.c: In function 'axienet_dma_err_handler':
   drivers/net/ethernet/xilinx/xilinx_axienet_main.c:2397:43: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    2397 |                         dev_kfree_skb_irq((struct sk_buff *)cur_p->tx_skb);
         |                                           ^
   drivers/net/ethernet/xilinx/xilinx_axienet_main.c: In function 'axienet_probe':
   drivers/net/ethernet/xilinx/xilinx_axienet_main.c:2719:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    2719 |         struct resource txtsres, rxtsres;
         |         ^~~~~~
   drivers/net/ethernet/xilinx/xilinx_axienet_main.c: At top level:
   drivers/net/ethernet/xilinx/xilinx_axienet_main.c:682:13: warning: 'axienet_tx_hwtstamp' defined but not used [-Wunused-function]
     682 | static void axienet_tx_hwtstamp(struct axienet_local *lp,
         |             ^~~~~~~~~~~~~~~~~~~


vim +690 drivers/net/ethernet/xilinx/xilinx_axienet_main.c

   673	
   674	#ifdef CONFIG_XILINX_AXI_EMAC_HWTSTAMP
   675	/**
   676	 * axienet_tx_hwtstamp - Read tx timestamp from hw and update it to the skbuff
   677	 * @lp:		Pointer to axienet local structure
   678	 * @cur_p:	Pointer to the axi_dma current bd
   679	 *
   680	 * Return:	None.
   681	 */
   682	static void axienet_tx_hwtstamp(struct axienet_local *lp,
   683					struct axidma_bd *cur_p)
   684	{
   685		u32 sec = 0, nsec = 0, val;
   686		u64 time64;
   687		int err = 0;
   688		u32 count, len = lp->axienet_config->tx_ptplen;
   689		struct skb_shared_hwtstamps *shhwtstamps =
 > 690			skb_hwtstamps((struct sk_buff *)cur_p->ptp_tx_skb);
   691	
   692		val = axienet_txts_ior(lp, XAXIFIFO_TXTS_ISR);
   693		if (unlikely(!(val & XAXIFIFO_TXTS_INT_RC_MASK)))
   694			dev_info(lp->dev, "Did't get FIFO tx interrupt %d\n", val);
   695	
   696		/* If FIFO is configured in cut through Mode we will get Rx complete
   697		 * interrupt even one byte is there in the fifo wait for the full packet
   698		 */
   699		err = readl_poll_timeout_atomic(lp->tx_ts_regs + XAXIFIFO_TXTS_RLR, val,
   700						((val & XAXIFIFO_TXTS_RXFD_MASK) >=
   701						len), 0, 1000000);
   702		if (err)
   703			netdev_err(lp->ndev, "%s: Didn't get the full timestamp packet",
   704				   __func__);
   705	
   706		nsec = axienet_txts_ior(lp, XAXIFIFO_TXTS_RXFD);
   707		sec  = axienet_txts_ior(lp, XAXIFIFO_TXTS_RXFD);
   708		val = axienet_txts_ior(lp, XAXIFIFO_TXTS_RXFD);
   709		val = ((val & XAXIFIFO_TXTS_TAG_MASK) >> XAXIFIFO_TXTS_TAG_SHIFT);
   710		dev_dbg(lp->dev, "tx_stamp:[%04x] %04x %u %9u\n",
   711			cur_p->ptp_tx_ts_tag, val, sec, nsec);
   712	
   713		if (val != cur_p->ptp_tx_ts_tag) {
   714			count = axienet_txts_ior(lp, XAXIFIFO_TXTS_RFO);
   715			while (count) {
   716				nsec = axienet_txts_ior(lp, XAXIFIFO_TXTS_RXFD);
   717				sec  = axienet_txts_ior(lp, XAXIFIFO_TXTS_RXFD);
   718				val = axienet_txts_ior(lp, XAXIFIFO_TXTS_RXFD);
   719				val = ((val & XAXIFIFO_TXTS_TAG_MASK) >>
   720					XAXIFIFO_TXTS_TAG_SHIFT);
   721	
   722				dev_dbg(lp->dev, "tx_stamp:[%04x] %04x %u %9u\n",
   723					cur_p->ptp_tx_ts_tag, val, sec, nsec);
   724				if (val == cur_p->ptp_tx_ts_tag)
   725					break;
   726				count = axienet_txts_ior(lp, XAXIFIFO_TXTS_RFO);
   727			}
   728			if (val != cur_p->ptp_tx_ts_tag) {
   729				dev_info(lp->dev, "Mismatching 2-step tag. Got %x",
   730					 val);
   731				dev_info(lp->dev, "Expected %x\n",
   732					 cur_p->ptp_tx_ts_tag);
   733			}
   734		}
   735	
   736		if (lp->axienet_config->mactype != XAXIENET_10G_25G)
   737			val = axienet_txts_ior(lp, XAXIFIFO_TXTS_RXFD);
   738	
   739		time64 = sec * NS_PER_SEC + nsec;
   740		memset(shhwtstamps, 0, sizeof(struct skb_shared_hwtstamps));
   741		shhwtstamps->hwtstamp = ns_to_ktime(time64);
   742		if (lp->axienet_config->mactype != XAXIENET_10G_25G)
   743			skb_pull((struct sk_buff *)cur_p->ptp_tx_skb,
   744				 AXIENET_TS_HEADER_LEN);
   745	
   746		skb_tstamp_tx((struct sk_buff *)cur_p->ptp_tx_skb, shhwtstamps);
   747		dev_kfree_skb_any((struct sk_buff *)cur_p->ptp_tx_skb);
   748		cur_p->ptp_tx_skb = 0;
   749	}
   750	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp



More information about the linux-arm-kernel mailing list