Re: [PATCH net-next v3 08/12] net: stmmac: Pass stmmac_priv in some callbacks

Andrew Halaney
2023-04-07T17:35:43Z

On Sat, Apr 01, 2023 at 05:06:21PM +0200, Simon Horman wrote:
> On Fri, Mar 31, 2023 at 04:45:45PM -0500, Andrew Halaney wrote:
> > Passing stmmac_priv to some of the callbacks allows hwif implementations
> > to grab some data that platforms can customize. Adjust the callbacks
> > accordingly in preparation of such a platform customization.
> >
> > Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
>
> ...
>
> > #define stmmac_reset(__priv, __args...) \
> > @@ -223,59 +240,59 @@ struct stmmac_dma_ops {
> > #define stmmac_dma_init(__priv, __args...) \
> > stmmac_do_void_callback(__priv, dma, init, __args)
> > #define stmmac_init_chan(__priv, __args...) \
> > - stmmac_do_void_callback(__priv, dma, init_chan, __args)
> > + stmmac_do_void_callback(__priv, dma, init_chan, __priv, __args)
>
> Hi Andrew,
>
> Rather than maintaining these macros can we just get rid of them?
> I'd be surprised if things aren't nicer with functions in their place [1].
>
> f.e., we now have (__priv, ..., __priv, ...) due to a generalisation
> that seems to take a lot more than it gives.
>
> [1] https://lore.kernel.org/linux-arm-kernel/ZBst1SzcIS4j+t46@corigine.com/
>

Thanks for the pointer. I think that makes sense, I'll take that
approach for these functions (and maybe in a follow-up series I'll
tackle all of them just because the lack of consistency will eat me up).

Sorry for the delay, had some issues around the house that became
urgent.

Thanks,
Andrew