lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202010220814.oGRjkazJ-lkp@intel.com>
Date:   Thu, 22 Oct 2020 08:45:52 +0800
From:   kernel test robot <lkp@...el.com>
To:     Łukasz Stelmach <l.stelmach@...sung.com>,
        Andrew Lunn <andrew@...n.ch>, jim.cromie@...il.com,
        Heiner Kallweit <hkallweit1@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Kukjin Kim <kgene@...nel.org>,
        Krzysztof Kozlowski <krzk@...nel.org>,
        Russell King <linux@...linux.org.uk>
Cc:     kbuild-all@...ts.01.org, netdev@...r.kernel.org
Subject: Re: [PATCH v3 3/5] net: ax88796c: ASIX AX88796C SPI Ethernet Adapter
 Driver

Hi "Łukasz,

I love your patch! Perhaps something to improve:

[auto build test WARNING on robh/for-next]
[also build test WARNING on arm/for-next net-next/master net/master linus/master sparc-next/master v5.9 next-20201021]
[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/AX88796C-SPI-Ethernet-Adapter/20201022-055114
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: sparc-allyesconfig (attached as .config)
compiler: sparc64-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://github.com/0day-ci/linux/commit/ad76ebe329affe7e5e8c1438f38ffe3bbf3a7083
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review ukasz-Stelmach/AX88796C-SPI-Ethernet-Adapter/20201022-055114
        git checkout ad76ebe329affe7e5e8c1438f38ffe3bbf3a7083
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sparc 

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

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/asix/ax88796c_main.c:758:13: error: static declaration of 'ax88796c_set_csums' follows non-static declaration
     758 | static void ax88796c_set_csums(struct ax88796c_device *ax_local)
         |             ^~~~~~~~~~~~~~~~~~
   In file included from drivers/net/ethernet/asix/ax88796c_main.c:12:
   drivers/net/ethernet/asix/ax88796c_ioctl.h:24:6: note: previous declaration of 'ax88796c_set_csums' was here
      24 | void ax88796c_set_csums(struct ax88796c_device *ax_local);
         |      ^~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/asix/ax88796c_main.c: In function 'ax88796c_probe':
>> drivers/net/ethernet/asix/ax88796c_main.c:978:32: warning: conversion from 'long unsigned int' to 'u32' {aka 'unsigned int'} changes value from '18446744073709486079' to '4294901759' [-Woverflow]
     978 |  ax_local->mdiobus->phy_mask = ~BIT(AX88796C_PHY_ID);
         |                                ^
   In file included from drivers/net/ethernet/asix/ax88796c_main.h:15,
                    from drivers/net/ethernet/asix/ax88796c_main.c:11:
   At top level:
   drivers/net/ethernet/asix/ax88796c_spi.h:24:17: warning: 'rx_cmd_buf' defined but not used [-Wunused-const-variable=]
      24 | static const u8 rx_cmd_buf[5] = {AX_SPICMD_READ_RXQ, 0xFF, 0xFF, 0xFF, 0xFF};
         |                 ^~~~~~~~~~

vim +978 drivers/net/ethernet/asix/ax88796c_main.c

   943	
   944	static int ax88796c_probe(struct spi_device *spi)
   945	{
   946		struct net_device *ndev;
   947		struct ax88796c_device *ax_local;
   948		char phy_id[MII_BUS_ID_SIZE + 3];
   949		int ret;
   950		u16 temp;
   951	
   952		ndev = devm_alloc_etherdev(&spi->dev, sizeof(*ax_local));
   953		if (!ndev)
   954			return -ENOMEM;
   955	
   956		SET_NETDEV_DEV(ndev, &spi->dev);
   957	
   958		ax_local = to_ax88796c_device(ndev);
   959		memset(ax_local, 0, sizeof(*ax_local));
   960	
   961		dev_set_drvdata(&spi->dev, ax_local);
   962		ax_local->spi = spi;
   963		ax_local->ax_spi.spi = spi;
   964	
   965		ax_local->ndev = ndev;
   966		ax_local->capabilities |= comp ? AX_CAP_COMP : 0;
   967		ax_local->msg_enable = msg_enable;
   968		mutex_init(&ax_local->spi_lock);
   969	
   970		ax_local->mdiobus = devm_mdiobus_alloc(&spi->dev);
   971		if (!ax_local->mdiobus)
   972			return -ENOMEM;
   973	
   974		ax_local->mdiobus->priv = ax_local;
   975		ax_local->mdiobus->read = ax88796c_mdio_read;
   976		ax_local->mdiobus->write = ax88796c_mdio_write;
   977		ax_local->mdiobus->name = "ax88976c-mdiobus";
 > 978		ax_local->mdiobus->phy_mask = ~BIT(AX88796C_PHY_ID);
   979		ax_local->mdiobus->parent = &spi->dev;
   980	
   981		snprintf(ax_local->mdiobus->id, MII_BUS_ID_SIZE,
   982			 "ax88796c-%s.%u", dev_name(&spi->dev), spi->chip_select);
   983	
   984		ret = devm_mdiobus_register(&spi->dev, ax_local->mdiobus);
   985		if (ret < 0) {
   986			dev_err(&spi->dev, "Could not register MDIO bus\n");
   987			return ret;
   988		}
   989	
   990		if (netif_msg_probe(ax_local)) {
   991			dev_info(&spi->dev, "AX88796C-SPI Configuration:\n");
   992			dev_info(&spi->dev, "    Compression : %s\n",
   993				 ax_local->capabilities & AX_CAP_COMP ? "ON" : "OFF");
   994		}
   995	
   996		ndev->irq = spi->irq;
   997		ndev->netdev_ops = &ax88796c_netdev_ops;
   998		ndev->ethtool_ops = &ax88796c_ethtool_ops;
   999		ndev->hw_features |= NETIF_F_HW_CSUM | NETIF_F_RXCSUM;
  1000		ndev->features |= NETIF_F_HW_CSUM | NETIF_F_RXCSUM;
  1001		ndev->hard_header_len += (TX_OVERHEAD + 4);
  1002	
  1003		mutex_lock(&ax_local->spi_lock);
  1004	
  1005		/* ax88796c gpio reset */
  1006		ax88796c_hard_reset(ax_local);
  1007	
  1008		/* Reset AX88796C */
  1009		ret = ax88796c_soft_reset(ax_local);
  1010		if (ret < 0) {
  1011			ret = -ENODEV;
  1012			goto err;
  1013		}
  1014		/* Check board revision */
  1015		temp = AX_READ(&ax_local->ax_spi, P2_CRIR);
  1016		if ((temp & 0xF) != 0x0) {
  1017			dev_err(&spi->dev, "spi read failed: %d\n", temp);
  1018			ret = -ENODEV;
  1019			goto err;
  1020		}
  1021	
  1022		temp = AX_READ(&ax_local->ax_spi, P0_BOR);
  1023		if (temp == 0x1234) {
  1024			ax_local->plat_endian = PLAT_LITTLE_ENDIAN;
  1025		} else {
  1026			AX_WRITE(&ax_local->ax_spi, 0xFFFF, P0_BOR);
  1027			ax_local->plat_endian = PLAT_BIG_ENDIAN;
  1028		}
  1029	
  1030		/*Reload EEPROM*/
  1031		ax88796c_reload_eeprom(ax_local);
  1032	
  1033		ax88796c_load_mac_addr(ndev);
  1034	
  1035		if (netif_msg_probe(ax_local))
  1036			dev_info(&spi->dev,
  1037				 "irq %d, MAC addr %02X:%02X:%02X:%02X:%02X:%02X\n",
  1038				 ndev->irq,
  1039				 ndev->dev_addr[0], ndev->dev_addr[1],
  1040				 ndev->dev_addr[2], ndev->dev_addr[3],
  1041				 ndev->dev_addr[4], ndev->dev_addr[5]);
  1042	
  1043		/* Disable power saving */
  1044		AX_WRITE(&ax_local->ax_spi, (AX_READ(&ax_local->ax_spi, P0_PSCR)
  1045					     & PSCR_PS_MASK) | PSCR_PS_D0, P0_PSCR);
  1046	
  1047		mutex_unlock(&ax_local->spi_lock);
  1048	
  1049		INIT_WORK(&ax_local->ax_work, ax88796c_work);
  1050	
  1051		skb_queue_head_init(&ax_local->tx_wait_q);
  1052	
  1053		snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT,
  1054			 ax_local->mdiobus->id, AX88796C_PHY_ID);
  1055		ax_local->phydev = phy_connect(ax_local->ndev, phy_id,
  1056					       ax88796c_handle_link_change,
  1057					       PHY_INTERFACE_MODE_MII);
  1058		if (IS_ERR(ax_local->phydev)) {
  1059			ret = PTR_ERR(ax_local->phydev);
  1060			goto err;
  1061		}
  1062		ax_local->phydev->irq = PHY_POLL;
  1063	
  1064		ret = devm_register_netdev(&spi->dev, ndev);
  1065		if (ret) {
  1066			dev_err(&spi->dev, "failed to register a network device\n");
  1067			goto err_phy_dis;
  1068		}
  1069	
  1070		netif_info(ax_local, probe, ndev, "%s %s registered\n",
  1071			   dev_driver_string(&spi->dev),
  1072			   dev_name(&spi->dev));
  1073		phy_attached_info(ax_local->phydev);
  1074	
  1075		return 0;
  1076	
  1077	err_phy_dis:
  1078		phy_disconnect(ax_local->phydev);
  1079	err:
  1080		return ret;
  1081	}
  1082	

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

Download attachment ".config.gz" of type "application/gzip" (66797 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ