RE: [PATCH v5 net-next 2/2] net: phy: micrel: Fix warn: passing zero to PTR_ERR

From: Divya.Koppera
Date: Tue Dec 13 2022 - 04:55:28 EST


Hi Andrew,

> -----Original Message-----
> From: Andrew Lunn <andrew@xxxxxxx>
> Sent: Monday, December 12, 2022 3:42 PM
> To: Divya Koppera - I30481 <Divya.Koppera@xxxxxxxxxxxxx>
> Cc: hkallweit1@xxxxxxxxx; linux@xxxxxxxxxxxxxxx; davem@xxxxxxxxxxxxx;
> edumazet@xxxxxxxxxx; kuba@xxxxxxxxxx; pabeni@xxxxxxxxxx;
> netdev@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
> richardcochran@xxxxxxxxx; UNGLinuxDriver
> <UNGLinuxDriver@xxxxxxxxxxxxx>
> Subject: Re: [PATCH v5 net-next 2/2] net: phy: micrel: Fix warn: passing zero
> to PTR_ERR
>
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the
> content is safe
>
> > > EXTERNAL EMAIL: Do not click links or open attachments unless you
> > > know the content is safe
> > >
> > > > > > - if (!IS_ENABLED(CONFIG_PTP_1588_CLOCK) ||
> > > > > > - !IS_ENABLED(CONFIG_NETWORK_PHY_TIMESTAMPING))
> > > > > > - return 0;
> > > > > > -
> > > > >
> > > > > Why are you removing this ?
> > > > >
> > > >
> > > > I got review comment from Richard in v2 as below, making it as
> > > > consistent
> > > by checking ptp_clock. So removed it in next revision.
> > > >
> > > > " > static int lan8814_ptp_probe_once(struct phy_device *phydev)
> > > > > {
> > > > > struct lan8814_shared_priv *shared =
> > > > > phydev->shared->priv;
> > > > >
> > > > > if (!IS_ENABLED(CONFIG_PTP_1588_CLOCK) ||
> > > > > !IS_ENABLED(CONFIG_NETWORK_PHY_TIMESTAMPING))
> > > > > return 0;
> > > >
> > > > It is weird to use macros here, but not before calling ptp_clock_register.
> > > > Make it consistent by checking shared->ptp_clock instead.
> > > > That is also better form."
> > >
> > > O.K. If Richard said this fine.
>
> Since Richard wants this removed, i would just remove it. The object code
> saving is probably not much.

Okay, then I'll resend the patch.

>
> Andrew