linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: phy: micrel: Fixes FIELD_GET assertion
@ 2022-10-03  6:31 Divya Koppera
  2022-10-04  0:08 ` Jakub Kicinski
  0 siblings, 1 reply; 4+ messages in thread
From: Divya Koppera @ 2022-10-03  6:31 UTC (permalink / raw)
  To: andrew, hkallweit1, linux, davem, edumazet, kuba, pabeni, netdev,
	linux-kernel
  Cc: UNGLinuxDriver

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>
---
 drivers/net/phy/micrel.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 3757e069c486..54a17b576eac 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -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);
 }
 
-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)) {
 	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) ==
 		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)) {
 	case KSZ8081_LMD_STAT_OPEN:
@@ -1871,7 +1871,8 @@ static bool ksz886x_cable_test_fault_length_valid(u16 status, u16 mask)
 	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;
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net: phy: micrel: Fixes FIELD_GET assertion
  2022-10-03  6:31 [PATCH net] net: phy: micrel: Fixes FIELD_GET assertion Divya Koppera
@ 2022-10-04  0:08 ` Jakub Kicinski
  2022-10-04  6:28   ` Divya.Koppera
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2022-10-04  0:08 UTC (permalink / raw)
  To: Divya Koppera
  Cc: andrew, hkallweit1, linux, davem, edumazet, pabeni, netdev,
	linux-kernel, UNGLinuxDriver

On Mon, 3 Oct 2022 12:01:30 +0530 Divya Koppera wrote:
> 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")

Does not apply cleanly to net, please rebase & resend.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH net] net: phy: micrel: Fixes FIELD_GET assertion
  2022-10-04  0:08 ` Jakub Kicinski
@ 2022-10-04  6:28   ` Divya.Koppera
  2022-10-04 20:36     ` Jakub Kicinski
  0 siblings, 1 reply; 4+ messages in thread
From: Divya.Koppera @ 2022-10-04  6:28 UTC (permalink / raw)
  To: kuba
  Cc: andrew, hkallweit1, linux, davem, edumazet, pabeni, netdev,
	linux-kernel, UNGLinuxDriver

Hi Jakub,

> -----Original Message-----
> From: Jakub Kicinski <kuba@kernel.org>
> Sent: Tuesday, October 4, 2022 5:39 AM
> To: Divya Koppera - I30481 <Divya.Koppera@microchip.com>
> Cc: andrew@lunn.ch; hkallweit1@gmail.com; linux@armlinux.org.uk;
> davem@davemloft.net; edumazet@google.com; pabeni@redhat.com;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org; UNGLinuxDriver
> <UNGLinuxDriver@microchip.com>
> Subject: Re: [PATCH net] net: phy: micrel: Fixes FIELD_GET assertion
> 
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the
> content is safe
> 
> On Mon, 3 Oct 2022 12:01:30 +0530 Divya Koppera wrote:
> > 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")
> 
> Does not apply cleanly to net, please rebase & resend.

I generated patch on net-next, as it is fix I kept for net. When I tried to apply these changes on net, this is getting failed as this main patch(21b688dabecb6a) did not go in net. Shall I resend patch for net-next?

Thanks,
Divya

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net: phy: micrel: Fixes FIELD_GET assertion
  2022-10-04  6:28   ` Divya.Koppera
@ 2022-10-04 20:36     ` Jakub Kicinski
  0 siblings, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2022-10-04 20:36 UTC (permalink / raw)
  To: Divya.Koppera
  Cc: andrew, hkallweit1, linux, davem, edumazet, pabeni, netdev,
	linux-kernel, UNGLinuxDriver

On Tue, 4 Oct 2022 06:28:44 +0000 Divya.Koppera@microchip.com wrote:
> > Does not apply cleanly to net, please rebase & resend.  
> 
> I generated patch on net-next, as it is fix I kept for net. When I
> tried to apply these changes on net, this is getting failed as this
> main patch(21b688dabecb6a) did not go in net. Shall I resend patch
> for net-next?

Maybe wait a day or two and rebase + resend in two day or so, we're
waiting to Linus to pull net-next after which point the trees will get
forwarded to the same point.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-04 20:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-03  6:31 [PATCH net] net: phy: micrel: Fixes FIELD_GET assertion Divya Koppera
2022-10-04  0:08 ` Jakub Kicinski
2022-10-04  6:28   ` Divya.Koppera
2022-10-04 20:36     ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).