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] [day] [month] [year] [list]
Message-ID: <202412041557.EtqjkJE5-lkp@intel.com>
Date: Wed, 4 Dec 2024 15:58:07 +0800
From: kernel test robot <lkp@...el.com>
To: Zhiyuan Wan <kmlinuxm@...il.com>, andrew@...n.ch
Cc: oe-kbuild-all@...ts.linux.dev, hkallweit1@...il.com,
	linux@...linux.org.uk, davem@...emloft.net, edumazet@...gle.com,
	kuba@...nel.org, pabeni@...hat.com, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org, willy.liu@...ltek.com,
	Zhiyuan Wan <kmlinuxm@...il.com>
Subject: Re: [PATCH net-next] net: phy: realtek: disable broadcast address
 feature of rtl8211f

Hi Zhiyuan,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Zhiyuan-Wan/net-phy-realtek-disable-broadcast-address-feature-of-rtl8211f/20241203-205751
base:   net-next/main
patch link:    https://lore.kernel.org/r/20241203125430.2078090-1-kmlinuxm%40gmail.com
patch subject: [PATCH net-next] net: phy: realtek: disable broadcast address feature of rtl8211f
config: i386-buildonly-randconfig-006 (https://download.01.org/0day-ci/archive/20241204/202412041557.EtqjkJE5-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241204/202412041557.EtqjkJE5-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412041557.EtqjkJE5-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/net/phy/realtek.c: In function 'rtl821x_probe':
>> drivers/net/phy/realtek.c:147:51: warning: passing argument 1 of 'PTR_ERR' makes pointer from integer without a cast [-Wint-conversion]
     147 |                 return dev_err_probe(dev, PTR_ERR(ret),
         |                                                   ^~~
         |                                                   |
         |                                                   int
   In file included from include/linux/kernfs.h:9,
                    from include/linux/sysfs.h:16,
                    from include/linux/kobject.h:20,
                    from include/linux/of.h:18,
                    from drivers/net/phy/realtek.c:11:
   include/linux/err.h:52:61: note: expected 'const void *' but argument is of type 'int'
      52 | static inline long __must_check PTR_ERR(__force const void *ptr)
         |                                                 ~~~~~~~~~~~~^~~


vim +/PTR_ERR +147 drivers/net/phy/realtek.c

   126	
   127	static int rtl821x_probe(struct phy_device *phydev)
   128	{
   129		struct device *dev = &phydev->mdio.dev;
   130		struct rtl821x_priv *priv;
   131		u32 phy_id = phydev->drv->phy_id;
   132		int ret;
   133	
   134		priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
   135		if (!priv)
   136			return -ENOMEM;
   137	
   138		priv->clk = devm_clk_get_optional_enabled(dev, NULL);
   139		if (IS_ERR(priv->clk))
   140			return dev_err_probe(dev, PTR_ERR(priv->clk),
   141					     "failed to get phy clock\n");
   142	
   143		dev_dbg(dev, "disabling MDIO address 0 for this phy");
   144		ret = phy_modify_paged(phydev, 0xa43, RTL8211F_PHYCR1,
   145					       RTL8211F_PHYAD0_EN, 0);
   146		if (ret < 0) {
 > 147			return dev_err_probe(dev, PTR_ERR(ret),
   148					     "disabling MDIO address 0 failed\n");
   149		}
   150		/* Deny broadcast address as PHY address */
   151		if (phydev->mdio.addr == 0)
   152			return -ENODEV;
   153	
   154		ret = phy_read_paged(phydev, 0xa43, RTL8211F_PHYCR1);
   155		if (ret < 0)
   156			return ret;
   157	
   158		priv->phycr1 = ret & (RTL8211F_ALDPS_PLL_OFF | RTL8211F_ALDPS_ENABLE | RTL8211F_ALDPS_XTAL_OFF);
   159		if (of_property_read_bool(dev->of_node, "realtek,aldps-enable"))
   160			priv->phycr1 |= RTL8211F_ALDPS_PLL_OFF | RTL8211F_ALDPS_ENABLE | RTL8211F_ALDPS_XTAL_OFF;
   161	
   162		priv->has_phycr2 = !(phy_id == RTL_8211FVD_PHYID);
   163		if (priv->has_phycr2) {
   164			ret = phy_read_paged(phydev, 0xa43, RTL8211F_PHYCR2);
   165			if (ret < 0)
   166				return ret;
   167	
   168			priv->phycr2 = ret & RTL8211F_CLKOUT_EN;
   169			if (of_property_read_bool(dev->of_node, "realtek,clkout-disable"))
   170				priv->phycr2 &= ~RTL8211F_CLKOUT_EN;
   171		}
   172	
   173		phydev->priv = priv;
   174	
   175		return 0;
   176	}
   177	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ