lkml.org 
[lkml]   [2022]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 net-next] net: phy: micrel: Fix warn: passing zero to PTR_ERR
The 12/01/2022 07:08, Divya Koppera - I30481 wrote:
> Hi Horatiu,
>
> > -----Original Message-----
> > From: Horatiu Vultur <horatiu.vultur@microchip.com>
> > Sent: Wednesday, November 30, 2022 8:21 PM
> > 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; kuba@kernel.org;
> > pabeni@redhat.com; netdev@vger.kernel.org; linux-
> > kernel@vger.kernel.org; richardcochran@gmail.com; UNGLinuxDriver
> > <UNGLinuxDriver@microchip.com>; Madhuri Sripada - I34878
> > <Madhuri.Sripada@microchip.com>
> > Subject: Re: [PATCH v3 net-next] net: phy: micrel: Fix warn: passing zero to
> > PTR_ERR
> >
> > The 11/29/2022 15:46, Divya Koppera wrote:
> >
> > Hi Divya,
> >
> > > Handle the NULL pointer case
> > >
> > > Fixes New smatch warnings:
> > > drivers/net/phy/micrel.c:2613 lan8814_ptp_probe_once() warn: passing
> > zero to 'PTR_ERR'
> > >
> > > Fixes Old smatch warnings:
> > > drivers/net/phy/micrel.c:1750 ksz886x_cable_test_get_status() error:
> > > uninitialized symbol 'ret'.
> >
> > Shouldn't you split this patch in 2 different patches, as you fix 2 issues.
>
> I got these warnings in single mail, so thought of fixing it in one patch. Also, one patch has single line change so did this way.
> Yeah, splitting sense good, will do in next revision.
>
> > Also any reason why you target net-next and not net? Because I can see the
> > blamed patches on net branch.
> >
>
> Initially I targeted for net-next and in second revision I moved to net as it is fix. But I got a comment as below. So again, targeted to net-next.
>
> "
> > v1 -> v2:
> > - Handled NULL pointer case
> > - Changed subject line with net-next to net
>
> This is not a genuine bug fix, and so it should target next-next."

That is fine by me.

...

> > >
> > >
> > > static void lan8814_ptp_init(struct phy_device *phydev) {
> > > + struct lan8814_shared_priv *shared_priv = phydev->shared->priv;
> > > struct kszphy_priv *priv = phydev->priv;
> > > struct kszphy_ptp_priv *ptp_priv = &priv->ptp_priv;
> > > u32 temp;
> > >
> > > - if (!IS_ENABLED(CONFIG_PTP_1588_CLOCK) ||
> > > - !IS_ENABLED(CONFIG_NETWORK_PHY_TIMESTAMPING))
> > > + /* Check if PHC support is missing at the configuration level */
> > > + if (!shared_priv->ptp_clock)
> > > return;

Sorry I forgot to mention this in the previous email.
Can you rename shared_priv to just shared. Because in all the other places
it is used shared and not shared_priv.

--
/Horatiu

\
 
 \ /
  Last update: 2022-12-01 09:22    [W:0.053 / U:0.868 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site