Re: [PATCH net-next 5/5] net: dsa: mv88e6xxx: move mv88e6xxx_hwtstamp_work() prototype

Vladimir Oltean
2025-09-16T09:03:32Z

On Tue, Sep 16, 2025 at 09:36:10AM +0100, Russell King (Oracle) wrote:
> On Tue, Sep 16, 2025 at 11:09:03AM +0300, Vladimir Oltean wrote:
> > On Mon, Sep 15, 2025 at 02:06:35PM +0100, Russell King (Oracle) wrote:
> > > Since mv88e6xxx_hwtstamp_work() is defined in hwtstamp.c, its
> > > prototype should be in hwtstamp.h, so move it there.
> > >
> > > Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> > > ---
> >
> > This leaves the shim definition (for when CONFIG_NET_DSA_MV88E6XXX_PTP
> > is not defined) in ptp.h. It creates an inconsistency and potential
> > problem - the same header should provide all definitions of the same
> > function.
>
> The only caller of mv88e6xxx_hwtstamp_work() is from ptp.c, and both
> hwtstamp.c which provides this function and ptp.c are only built if
> CONFIG_NET_DSA_MV88E6XXX_PTP is set. So, this shim serves no useful
> purpose.

Ok, in the same situation we have:
- mv88e6352_hwtstamp_port_enable()
- mv88e6352_hwtstamp_port_disable()
- mv88e6165_global_enable()
- mv88e6165_global_disable()

which have no shim definition in hwtstamp.h. So I agree that the
mv88e6xxx_hwtstamp_work() shim can be removed. The remaining functions
are called by chip.c, so they need the shim.