Re: [net-next PATCH v2 15/15] net: dsa: qca8k: drop unnecessary exposed function and make them static

From: Vladimir Oltean
Date: Tue Jul 19 2022 - 10:15:50 EST


On Tue, Jul 19, 2022 at 03:35:18PM +0200, Christian Marangi wrote:
> On Tue, Jul 19, 2022 at 04:29:31PM +0300, Vladimir Oltean wrote:
> > On Tue, Jul 19, 2022 at 02:57:26AM +0200, Christian Marangi wrote:
> > > Some function were exposed to permit migration to common code. Drop them
> > > and make them static now that the user are in the same common code.
> > >
> > > Signed-off-by: Christian Marangi <ansuelsmth@xxxxxxxxx>
> > > ---
> >
> > Hmm, ideally the last patch that removes a certain function from being
> > called from qca8k-8xxx.c would also delete its prototype and make it
> > static in qca8k-common.c. Would that be hard to change?
>
> Can be done, it's really to compile check the changes and fix them.
> Problem is that the patch number would explode. (ok explode is a big
> thing but i think that would add 2-3 more patch to this big series...
> this is why I did the static change as the last patch instead of in the
> middle of the series)
>
> But yes it's totally doable and not that hard honestly.

Why would it add to the patch count? I don't think you understood what I
meant.

Take for example qca8k_bulk_read(). You migrated it in patch 4, but
there was still a user left in qca8k_fdb_read(), which you migrated in
patch 5. After patch 5 and until the last one, the prototype of
qca8k_bulk_read() was essentially dangling, but you only removed it in
the last patch. My request is that you prune the dangling definitions
after each patch that stops using something exported. That won't
increase the number of changes, but eliminate the last one.
Also, it would be great if you could create a dependency graph such that
you could avoid temporarily exporting some functions that don't need to be.