Re: [PATCH 1/3] net: ax88796c: ASIX AX88796C SPI Ethernet Adapter Driver

kernel test robot
2020-08-25T21:12:55Z

[-- Attachment #1: Type: text/plain, Size: 14691 bytes --]

Hi "Łukasz,

I love your patch! Perhaps something to improve:

[auto build test WARNING on arm/for-next]
[also build test WARNING on net-next/master net/master linus/master sparc-next/master v5.9-rc2 next-20200825]
[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/ukasz-Stelmach/net-ax88796c-ASIX-AX88796C-SPI-Ethernet-Adapter-Driver/20200826-010937
base: git://git.armlinux.org.uk/~rmk/linux-arm.git for-next
config: m68k-allmodconfig (attached as .config)
compiler: m68k-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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k

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

All warnings (new ones prefixed by >>):

In file included from arch/m68k/include/asm/io_mm.h:25,
from arch/m68k/include/asm/io.h:8,
from include/linux/scatterlist.h:9,
from include/linux/dma-mapping.h:11,
from include/linux/skbuff.h:31,
from include/linux/if_ether.h:19,
from include/linux/etherdevice.h:20,
from drivers/net/ethernet/asix/ax88796c_main.h:19,
from drivers/net/ethernet/asix/ax88796c_main.c:9:
arch/m68k/include/asm/raw_io.h: In function 'raw_rom_outsb':
arch/m68k/include/asm/raw_io.h:83:7: warning: variable '__w' set but not used [-Wunused-but-set-variable]
83 | ({u8 __w, __v = (b); u32 _addr = ((u32) (addr)); \
| ^~~
arch/m68k/include/asm/raw_io.h:430:3: note: in expansion of macro 'rom_out_8'
430 | rom_out_8(port, *buf++);
| ^~~~~~~~~
arch/m68k/include/asm/raw_io.h: In function 'raw_rom_outsw':
arch/m68k/include/asm/raw_io.h:86:8: warning: variable '__w' set but not used [-Wunused-but-set-variable]
86 | ({u16 __w, __v = (w); u32 _addr = ((u32) (addr)); \
| ^~~
arch/m68k/include/asm/raw_io.h:448:3: note: in expansion of macro 'rom_out_be16'
448 | rom_out_be16(port, *buf++);
| ^~~~~~~~~~~~
arch/m68k/include/asm/raw_io.h: In function 'raw_rom_outsw_swapw':
arch/m68k/include/asm/raw_io.h:90:8: warning: variable '__w' set but not used [-Wunused-but-set-variable]
90 | ({u16 __w, __v = (w); u32 _addr = ((u32) (addr)); \
| ^~~
arch/m68k/include/asm/raw_io.h:466:3: note: in expansion of macro 'rom_out_le16'
466 | rom_out_le16(port, *buf++);
| ^~~~~~~~~~~~
In file included from include/linux/kernel.h:11,
from include/linux/skbuff.h:13,
from include/linux/if_ether.h:19,
from include/linux/etherdevice.h:20,
from drivers/net/ethernet/asix/ax88796c_main.h:19,
from drivers/net/ethernet/asix/ax88796c_main.c:9:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
In file included from arch/m68k/include/asm/bug.h:32,
from include/linux/bug.h:5,
from include/linux/thread_info.h:12,
from include/asm-generic/preempt.h:5,
from ./arch/m68k/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/skbuff.h:15,
from include/linux/if_ether.h:19,
from include/linux/etherdevice.h:20,
from drivers/net/ethernet/asix/ax88796c_main.h:19,
from drivers/net/ethernet/asix/ax88796c_main.c:9:
include/linux/dma-mapping.h: In function 'dma_map_resource':
arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
| ^~
include/asm-generic/bug.h:144:27: note: in definition of macro 'WARN_ON_ONCE'
144 | int __ret_warn_once = !!(condition); \
| ^~~~~~~~~
arch/m68k/include/asm/page_mm.h:170:25: note: in expansion of macro 'virt_addr_valid'
170 | #define pfn_valid(pfn) virt_addr_valid(pfn_to_virt(pfn))
| ^~~~~~~~~~~~~~~
include/linux/dma-mapping.h:352:19: note: in expansion of macro 'pfn_valid'
352 | if (WARN_ON_ONCE(pfn_valid(PHYS_PFN(phys_addr))))
| ^~~~~~~~~
drivers/net/ethernet/asix/ax88796c_main.c: In function 'ax88796c_rx_fixup':
drivers/net/ethernet/asix/ax88796c_main.c:604:8: warning: unused variable 'i' [-Wunused-variable]
604 | int i;
| ^
drivers/net/ethernet/asix/ax88796c_main.c: At top level:
>> drivers/net/ethernet/asix/ax88796c_main.c:887:6: warning: no previous prototype for 'ax88796c_phy_init' [-Wmissing-prototypes]
887 | void ax88796c_phy_init(struct ax88796c_device *ax_local)
| ^~~~~~~~~~~~~~~~~
drivers/net/ethernet/asix/ax88796c_main.c:1242:1: warning: 'ax88796c_resume' defined but not used [-Wunused-function]
1242 | ax88796c_resume(struct spi_device *spi)
| ^~~~~~~~~~~~~~~
drivers/net/ethernet/asix/ax88796c_main.c:1186:1: warning: 'ax88796c_suspend' defined but not used [-Wunused-function]
1186 | ax88796c_suspend(struct spi_device *spi, pm_message_t mesg)
| ^~~~~~~~~~~~~~~~
In file included from drivers/net/ethernet/asix/ax88796c_main.h:39,
from drivers/net/ethernet/asix/ax88796c_main.c:9:
drivers/net/ethernet/asix/ax88796c_spi.h:22:17: warning: 'rx_cmd_buf' defined but not used [-Wunused-const-variable=]
22 | static const u8 rx_cmd_buf[5] = {AX_SPICMD_READ_RXQ, 0xFF, 0xFF, 0xFF, 0xFF};
| ^~~~~~~~~~
--
In file included from arch/m68k/include/asm/io_mm.h:25,
from arch/m68k/include/asm/io.h:8,
from include/linux/scatterlist.h:9,
from include/linux/dma-mapping.h:11,
from include/linux/skbuff.h:31,
from include/linux/if_ether.h:19,
from include/linux/etherdevice.h:20,
from drivers/net/ethernet/asix/ax88796c_main.h:19,
from drivers/net/ethernet/asix/ax88796c_ioctl.c:9:
arch/m68k/include/asm/raw_io.h: In function 'raw_rom_outsb':
arch/m68k/include/asm/raw_io.h:83:7: warning: variable '__w' set but not used [-Wunused-but-set-variable]
83 | ({u8 __w, __v = (b); u32 _addr = ((u32) (addr)); \
| ^~~
arch/m68k/include/asm/raw_io.h:430:3: note: in expansion of macro 'rom_out_8'
430 | rom_out_8(port, *buf++);
| ^~~~~~~~~
arch/m68k/include/asm/raw_io.h: In function 'raw_rom_outsw':
arch/m68k/include/asm/raw_io.h:86:8: warning: variable '__w' set but not used [-Wunused-but-set-variable]
86 | ({u16 __w, __v = (w); u32 _addr = ((u32) (addr)); \
| ^~~
arch/m68k/include/asm/raw_io.h:448:3: note: in expansion of macro 'rom_out_be16'
448 | rom_out_be16(port, *buf++);
| ^~~~~~~~~~~~
arch/m68k/include/asm/raw_io.h: In function 'raw_rom_outsw_swapw':
arch/m68k/include/asm/raw_io.h:90:8: warning: variable '__w' set but not used [-Wunused-but-set-variable]
90 | ({u16 __w, __v = (w); u32 _addr = ((u32) (addr)); \
| ^~~
arch/m68k/include/asm/raw_io.h:466:3: note: in expansion of macro 'rom_out_le16'
466 | rom_out_le16(port, *buf++);
| ^~~~~~~~~~~~
In file included from include/linux/kernel.h:11,
from include/linux/skbuff.h:13,
from include/linux/if_ether.h:19,
from include/linux/etherdevice.h:20,
from drivers/net/ethernet/asix/ax88796c_main.h:19,
from drivers/net/ethernet/asix/ax88796c_ioctl.c:9:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
In file included from arch/m68k/include/asm/bug.h:32,
from include/linux/bug.h:5,
from include/linux/thread_info.h:12,
from include/asm-generic/preempt.h:5,
from ./arch/m68k/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/skbuff.h:15,
from include/linux/if_ether.h:19,
from include/linux/etherdevice.h:20,
from drivers/net/ethernet/asix/ax88796c_main.h:19,
from drivers/net/ethernet/asix/ax88796c_ioctl.c:9:
include/linux/dma-mapping.h: In function 'dma_map_resource':
arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
| ^~
include/asm-generic/bug.h:144:27: note: in definition of macro 'WARN_ON_ONCE'
144 | int __ret_warn_once = !!(condition); \
| ^~~~~~~~~
arch/m68k/include/asm/page_mm.h:170:25: note: in expansion of macro 'virt_addr_valid'
170 | #define pfn_valid(pfn) virt_addr_valid(pfn_to_virt(pfn))
| ^~~~~~~~~~~~~~~
include/linux/dma-mapping.h:352:19: note: in expansion of macro 'pfn_valid'
352 | if (WARN_ON_ONCE(pfn_valid(PHYS_PFN(phys_addr))))
| ^~~~~~~~~
drivers/net/ethernet/asix/ax88796c_ioctl.c: At top level:
>> drivers/net/ethernet/asix/ax88796c_ioctl.c:272:19: warning: initialized field overwritten [-Woverride-init]
272 | .get_msglevel = ax88796c_ethtool_getmsglevel,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/asix/ax88796c_ioctl.c:272:19: note: (near initialization for 'ax88796c_ethtool_ops.get_msglevel')
drivers/net/ethernet/asix/ax88796c_ioctl.c:273:19: warning: initialized field overwritten [-Woverride-init]
273 | .set_msglevel = ax88796c_ethtool_setmsglevel,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/asix/ax88796c_ioctl.c:273:19: note: (near initialization for 'ax88796c_ethtool_ops.set_msglevel')
In file included from drivers/net/ethernet/asix/ax88796c_main.h:39,
from drivers/net/ethernet/asix/ax88796c_ioctl.c:9:
drivers/net/ethernet/asix/ax88796c_spi.h:23:17: warning: 'tx_cmd_buf' defined but not used [-Wunused-const-variable=]
23 | static const u8 tx_cmd_buf[4] = {AX_SPICMD_WRITE_TXQ, 0xFF, 0xFF, 0xFF};
| ^~~~~~~~~~
drivers/net/ethernet/asix/ax88796c_spi.h:22:17: warning: 'rx_cmd_buf' defined but not used [-Wunused-const-variable=]
22 | static const u8 rx_cmd_buf[5] = {AX_SPICMD_READ_RXQ, 0xFF, 0xFF, 0xFF, 0xFF};
| ^~~~~~~~~~

# https://github.com/0day-ci/linux/commit/3309776d77d5d4854894d39683ef649eceda5e7d
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review ukasz-Stelmach/net-ax88796c-ASIX-AX88796C-SPI-Ethernet-Adapter-Driver/20200826-010937
git checkout 3309776d77d5d4854894d39683ef649eceda5e7d
vim +/ax88796c_phy_init +887 drivers/net/ethernet/asix/ax88796c_main.c

886
> 887 void ax88796c_phy_init(struct ax88796c_device *ax_local)
888 {
889 u16 advertise = ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP;
890
891 /* Setup LED mode */
892 AX_WRITE(&ax_local->ax_spi,
893 (LCR_LED0_EN | LCR_LED0_DUPLEX | LCR_LED1_EN |
894 LCR_LED1_100MODE), P2_LCR0);
895 AX_WRITE(&ax_local->ax_spi,
896 (AX_READ(&ax_local->ax_spi, P2_LCR1) & LCR_LED2_MASK) |
897 LCR_LED2_EN | LCR_LED2_LINK, P2_LCR1);
898
899 /* Enable PHY auto-polling */
900 AX_WRITE(&ax_local->ax_spi,
901 POOLCR_PHYID(ax_local->mii.phy_id) | POOLCR_POLL_EN |
902 POOLCR_POLL_FLOWCTRL | POOLCR_POLL_BMCR, P2_POOLCR);
903
904 ax88796c_mdio_write(ax_local->ndev,
905 ax_local->mii.phy_id, MII_ADVERTISE, advertise);
906
907 ax88796c_mdio_write(ax_local->ndev, ax_local->mii.phy_id, MII_BMCR,
908 BMCR_SPEED100 | BMCR_ANENABLE | BMCR_ANRESTART);
909 }
910

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 57251 bytes --]