net: phy: micrel: Fixes FIELD_GET assertion
FIELD_GET() must only be used with a mask that is a compile-time constant. Mark the functions as __always_inline to avoid the problem. Fixes: 21b688dabecb6a ("net: phy: micrel: Cable Diag feature for lan8814 phy") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Divya Koppera <Divya.Koppera@microchip.com> Link: https://lore.kernel.org/r/20221011095437.12580-1-Divya.Koppera@microchip.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
3c1860543f
commit
fa182ea26f
@ -1838,7 +1838,7 @@ static int ksz886x_cable_test_start(struct phy_device *phydev)
|
|||||||
return phy_clear_bits(phydev, MII_BMCR, BMCR_ANENABLE | BMCR_SPEED100);
|
return phy_clear_bits(phydev, MII_BMCR, BMCR_ANENABLE | BMCR_SPEED100);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ksz886x_cable_test_result_trans(u16 status, u16 mask)
|
static __always_inline int ksz886x_cable_test_result_trans(u16 status, u16 mask)
|
||||||
{
|
{
|
||||||
switch (FIELD_GET(mask, status)) {
|
switch (FIELD_GET(mask, status)) {
|
||||||
case KSZ8081_LMD_STAT_NORMAL:
|
case KSZ8081_LMD_STAT_NORMAL:
|
||||||
@ -1854,13 +1854,13 @@ static int ksz886x_cable_test_result_trans(u16 status, u16 mask)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ksz886x_cable_test_failed(u16 status, u16 mask)
|
static __always_inline bool ksz886x_cable_test_failed(u16 status, u16 mask)
|
||||||
{
|
{
|
||||||
return FIELD_GET(mask, status) ==
|
return FIELD_GET(mask, status) ==
|
||||||
KSZ8081_LMD_STAT_FAIL;
|
KSZ8081_LMD_STAT_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ksz886x_cable_test_fault_length_valid(u16 status, u16 mask)
|
static __always_inline bool ksz886x_cable_test_fault_length_valid(u16 status, u16 mask)
|
||||||
{
|
{
|
||||||
switch (FIELD_GET(mask, status)) {
|
switch (FIELD_GET(mask, status)) {
|
||||||
case KSZ8081_LMD_STAT_OPEN:
|
case KSZ8081_LMD_STAT_OPEN:
|
||||||
@ -1871,7 +1871,8 @@ static bool ksz886x_cable_test_fault_length_valid(u16 status, u16 mask)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ksz886x_cable_test_fault_length(struct phy_device *phydev, u16 status, u16 data_mask)
|
static __always_inline int ksz886x_cable_test_fault_length(struct phy_device *phydev,
|
||||||
|
u16 status, u16 data_mask)
|
||||||
{
|
{
|
||||||
int dt;
|
int dt;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user