From: Leon Romanovsky <leon@kernel•org>
To: Divya Koppera <Divya.Koppera@microchip•com>
Cc: andrew@lunn•ch, hkallweit1@gmail•com, linux@armlinux•org.uk,
davem@davemloft•net, edumazet@google•com, kuba@kernel•org,
pabeni@redhat•com, netdev@vger•kernel.org,
linux-kernel@vger•kernel.org, UNGLinuxDriver@microchip•com
Subject: Re: [RESEND PATCH net] net: phy: micrel: Fixes FIELD_GET assertion
Date: Tue, 11 Oct 2022 14:32:42 +0300 [thread overview]
Message-ID: <Y0VUWvJgBXVADpYD@unreal> (raw)
In-Reply-To: <20221011095437.12580-1-Divya.Koppera@microchip.com>
On Tue, Oct 11, 2022 at 03:24:37PM +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")
> 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)
I don't think that this is valid workaround. You are adding inline
function to C-files.
Please find another solution. For example, adding new field_get function
to bitfield.h that accepts dynamic fields.
Thanks
next prev parent reply other threads:[~2022-10-11 11:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-11 9:54 [RESEND PATCH net] net: phy: micrel: Fixes FIELD_GET assertion Divya Koppera
2022-10-11 11:32 ` Leon Romanovsky [this message]
2022-10-13 1:50 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y0VUWvJgBXVADpYD@unreal \
--to=leon@kernel$(echo .)org \
--cc=Divya.Koppera@microchip$(echo .)com \
--cc=UNGLinuxDriver@microchip$(echo .)com \
--cc=andrew@lunn$(echo .)ch \
--cc=davem@davemloft$(echo .)net \
--cc=edumazet@google$(echo .)com \
--cc=hkallweit1@gmail$(echo .)com \
--cc=kuba@kernel$(echo .)org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux@armlinux$(echo .)org.uk \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox