tree:
https://github.com/lunn/linux.git v5.8-rc1-net-next-phy-subdirs
head: 6758dc32213e56e6ddd16049bc0cf1e1a36ce270
commit: 55b85b0b27e41f822363c40083b44daae8b2e5dd [2/3] net: phy: Move into subdirectories
config: i386-randconfig-s002-20200621 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-rc2-13-gc59158c8-dirty
git checkout 55b85b0b27e41f822363c40083b44daae8b2e5dd
# save the attached .config to linux build tree
make W=1 C=1 ARCH=i386 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
In file included from include/linux/phy.h:14,
from drivers/net/phy/phy/at803x.c:10:
drivers/net/phy/phy/at803x.c: In function 'at803x_parse_dt':
include/linux/bitfield.h:52:28: warning: comparison is always false due to limited range
of data type [-Wtype-limits]
52 | BUILD_BUG_ON_MSG((_mask) > (typeof(_reg))~0ull, |
^
include/linux/compiler.h:372:9: note: in definition of macro
'__compiletime_assert'
372 | if (!(condition)) | ^~~~~~~~~
include/linux/compiler.h:392:2: note: in expansion of macro '_compiletime_assert'
392 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:52:3: note: in expansion of macro 'BUILD_BUG_ON_MSG'
52 | BUILD_BUG_ON_MSG((_mask) > (typeof(_reg))~0ull, | ^~~~~~~~~~~~~~~~
include/linux/bitfield.h:94:3: note: in expansion of macro '__BF_FIELD_CHECK'
94 | __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); |
^~~~~~~~~~~~~~~~
> drivers/net/phy/phy/at803x.c:431:24: note: in expansion of macro
'FIELD_PREP'
431 | priv->clk_25m_reg |= FIELD_PREP(mask, sel);
| ^~~~~~~~~~
sparse warnings: (new ones prefixed by >>)
> drivers/net/phy/phy/mscc/mscc_macsec.c:391:42: sparse: sparse:
cast from restricted sci_t
> drivers/net/phy/phy/mscc/mscc_macsec.c:393:42: sparse: sparse: restricted sci_t
degrades to integer
> drivers/net/phy/phy/mscc/mscc_macsec.c:400:42: sparse: sparse: restricted __be16
degrades to integer
drivers/net/phy/phy/mscc/mscc_macsec.c:606:34: sparse:
sparse: cast from restricted sci_t
drivers/net/phy/phy/mscc/mscc_macsec.c:608:34: sparse: sparse: restricted sci_t
degrades to integer
vim +/FIELD_PREP +431 drivers/net/phy/phy/at803x.c
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 398
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 399 static int
at803x_parse_dt(struct phy_device *phydev)
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 400 {
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 401 struct
device_node *node = phydev->mdio.dev.of_node;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 402 struct
at803x_priv *priv = phydev->priv;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 403 unsigned int
sel, mask;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 404 u32 freq,
strength;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 405 int ret;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 406
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 407 if
(!IS_ENABLED(CONFIG_OF_MDIO))
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 408 return 0;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 409
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 410 ret =
of_property_read_u32(node, "qca,clk-out-frequency", &freq);
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 411 if (!ret) {
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 412 mask =
AT803X_CLK_OUT_MASK;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 413 switch (freq)
{
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 414 case 25000000:
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 415 sel =
AT803X_CLK_OUT_25MHZ_XTAL;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 416 break;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 417 case 50000000:
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 418 sel =
AT803X_CLK_OUT_50MHZ_PLL;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 419 break;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 420 case 62500000:
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 421 sel =
AT803X_CLK_OUT_62_5MHZ_PLL;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 422 break;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 423 case
125000000:
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 424 sel =
AT803X_CLK_OUT_125MHZ_PLL;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 425 break;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 426 default:
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 427
phydev_err(phydev, "invalid qca,clk-out-frequency\n");
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 428 return
-EINVAL;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 429 }
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 430
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 @431
priv->clk_25m_reg |= FIELD_PREP(mask, sel);
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 432
priv->clk_25m_mask |= mask;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 433
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 434 /* Fixup for
the AR8030/AR8035. This chip has another mask and
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 435 * doesn't
support the DSP reference. Eg. the lowest bit of the
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 436 * mask. The
upper two bits select the same frequencies. Mask
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 437 * the lowest
bit here.
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 438 *
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 439 * Warning:
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 440 * There was
no datasheet for the AR8030 available so this is
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 441 * just a
guess. But the AR8035 is listed as pin compatible
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 442 * to the
AR8030 so there might be a good chance it works on
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 443 * the AR8030
too.
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 444 */
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 445 if
(at803x_match_phy_id(phydev, ATH8030_PHY_ID) ||
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 446
at803x_match_phy_id(phydev, ATH8035_PHY_ID)) {
b1f4c209d84057b drivers/net/phy/at803x.c Oleksij Rempel 2020-04-01 447
priv->clk_25m_reg &= AT8035_CLK_OUT_MASK;
b1f4c209d84057b drivers/net/phy/at803x.c Oleksij Rempel 2020-04-01 448
priv->clk_25m_mask &= AT8035_CLK_OUT_MASK;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 449 }
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 450 }
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 451
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 452 ret =
of_property_read_u32(node, "qca,clk-out-strength", &strength);
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 453 if (!ret) {
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 454
priv->clk_25m_mask |= AT803X_CLK_OUT_STRENGTH_MASK;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 455 switch
(strength) {
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 456 case
AR803X_STRENGTH_FULL:
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 457
priv->clk_25m_reg |= AT803X_CLK_OUT_STRENGTH_FULL;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 458 break;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 459 case
AR803X_STRENGTH_HALF:
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 460
priv->clk_25m_reg |= AT803X_CLK_OUT_STRENGTH_HALF;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 461 break;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 462 case
AR803X_STRENGTH_QUARTER:
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 463
priv->clk_25m_reg |= AT803X_CLK_OUT_STRENGTH_QUARTER;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 464 break;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 465 default:
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 466
phydev_err(phydev, "invalid qca,clk-out-strength\n");
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 467 return
-EINVAL;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 468 }
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 469 }
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 470
428061f70f1aa3a drivers/net/phy/at803x.c Michael Walle 2019-11-06 471 /* Only
supported on AR8031/AR8033, the AR8030/AR8035 use strapping
428061f70f1aa3a drivers/net/phy/at803x.c Michael Walle 2019-11-06 472 * options.
428061f70f1aa3a drivers/net/phy/at803x.c Michael Walle 2019-11-06 473 */
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 474 if
(at803x_match_phy_id(phydev, ATH8031_PHY_ID)) {
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 475 if
(of_property_read_bool(node, "qca,keep-pll-enabled"))
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 476 priv->flags
|= AT803X_KEEP_PLL_ENABLED;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 477
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 478 ret =
at8031_register_regulators(phydev);
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 479 if (ret <
0)
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 480 return ret;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 481
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 482 priv->vddio
= devm_regulator_get_optional(&phydev->mdio.dev,
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 483
"vddio");
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 484 if
(IS_ERR(priv->vddio)) {
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 485
phydev_err(phydev, "failed to get VDDIO regulator\n");
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 486 return
PTR_ERR(priv->vddio);
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 487 }
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 488
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 489 ret =
regulator_enable(priv->vddio);
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 490 if (ret <
0)
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 491 return ret;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 492 }
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 493
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 494 return 0;
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 495 }
2f664823a47021a drivers/net/phy/at803x.c Michael Walle 2019-11-06 496
:::::: The code at line 431 was first introduced by commit
:::::: 2f664823a47021ae029fe91272adbf0a223e477f net: phy: at803x: add device tree binding
:::::: TO: Michael Walle <michael(a)walle.cc>
:::::: CC: David S. Miller <davem(a)davemloft.net>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org