Re: [PATCH v4 33/36] net: faraday add nds32 support.

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

 



Hi Greentime,

I love your patch! Perhaps something to improve:

[auto build test WARNING on tip/timers/core]
[cannot apply to linus/master v4.15-rc4 next-20171220]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Greentime-Hu/Andes-nds32-Linux-Kernel/20171220-155937
reproduce:
        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)


vim +205 drivers/net/ethernet/faraday/ftmac100.c

8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  199  
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  200  /******************************************************************************
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  201   * internal functions (receive descriptor)
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  202   *****************************************************************************/
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  203  static bool ftmac100_rxdes_first_segment(struct ftmac100_rxdes *rxdes)
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  204  {
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28 @205  	return rxdes->rxdes0 & cpu_to_le32(FTMAC100_RXDES0_FRS);
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  206  }
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  207  
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  208  static bool ftmac100_rxdes_last_segment(struct ftmac100_rxdes *rxdes)
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  209  {
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  210  	return rxdes->rxdes0 & cpu_to_le32(FTMAC100_RXDES0_LRS);
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  211  }
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  212  
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  213  static bool ftmac100_rxdes_owned_by_dma(struct ftmac100_rxdes *rxdes)
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  214  {
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28 @215  	return rxdes->rxdes0 & cpu_to_le32(FTMAC100_RXDES0_RXDMA_OWN);
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  216  }
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  217  
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  218  static void ftmac100_rxdes_set_dma_own(struct ftmac100_rxdes *rxdes)
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  219  {
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  220  	/* clear status bits */
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28 @221  	rxdes->rxdes0 = cpu_to_le32(FTMAC100_RXDES0_RXDMA_OWN);
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  222  }
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  223  
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  224  static bool ftmac100_rxdes_rx_error(struct ftmac100_rxdes *rxdes)
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  225  {
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  226  	return rxdes->rxdes0 & cpu_to_le32(FTMAC100_RXDES0_RX_ERR);
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  227  }
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  228  
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  229  static bool ftmac100_rxdes_crc_error(struct ftmac100_rxdes *rxdes)
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  230  {
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  231  	return rxdes->rxdes0 & cpu_to_le32(FTMAC100_RXDES0_CRC_ERR);
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  232  }
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  233  
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  234  static bool ftmac100_rxdes_frame_too_long(struct ftmac100_rxdes *rxdes)
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  235  {
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  236  	return rxdes->rxdes0 & cpu_to_le32(FTMAC100_RXDES0_FTL);
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  237  }
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  238  
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  239  static bool ftmac100_rxdes_runt(struct ftmac100_rxdes *rxdes)
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  240  {
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  241  	return rxdes->rxdes0 & cpu_to_le32(FTMAC100_RXDES0_RUNT);
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  242  }
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  243  
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  244  static bool ftmac100_rxdes_odd_nibble(struct ftmac100_rxdes *rxdes)
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  245  {
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  246  	return rxdes->rxdes0 & cpu_to_le32(FTMAC100_RXDES0_RX_ODD_NB);
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  247  }
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  248  
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  249  static unsigned int ftmac100_rxdes_frame_length(struct ftmac100_rxdes *rxdes)
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  250  {
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28 @251  	return le32_to_cpu(rxdes->rxdes0) & FTMAC100_RXDES0_RFL;
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  252  }
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  253  
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  254  static bool ftmac100_rxdes_multicast(struct ftmac100_rxdes *rxdes)
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  255  {
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  256  	return rxdes->rxdes0 & cpu_to_le32(FTMAC100_RXDES0_MULTICAST);
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  257  }
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  258  
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  259  static void ftmac100_rxdes_set_buffer_size(struct ftmac100_rxdes *rxdes,
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  260  					   unsigned int size)
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  261  {
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28 @262  	rxdes->rxdes1 &= cpu_to_le32(FTMAC100_RXDES1_EDORR);
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  263  	rxdes->rxdes1 |= cpu_to_le32(FTMAC100_RXDES1_RXBUF_SIZE(size));
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  264  }
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  265  
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  266  static void ftmac100_rxdes_set_end_of_ring(struct ftmac100_rxdes *rxdes)
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  267  {
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  268  	rxdes->rxdes1 |= cpu_to_le32(FTMAC100_RXDES1_EDORR);
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  269  }
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  270  
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  271  static void ftmac100_rxdes_set_dma_addr(struct ftmac100_rxdes *rxdes,
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  272  					dma_addr_t addr)
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  273  {
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28 @274  	rxdes->rxdes2 = cpu_to_le32(addr);
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  275  }
8d77c036 drivers/net/ftmac100.c Po-Yu Chuang 2011-02-28  276  

:::::: The code at line 205 was first introduced by commit
:::::: 8d77c036b57cf813d838f859e11b6a188acdb1fb net: add Faraday FTMAC100 10/100 Ethernet driver

:::::: TO: Po-Yu Chuang <ratbert@xxxxxxxxxxxxxxxx>
:::::: CC: David S. Miller <davem@xxxxxxxxxxxxx>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation



[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux