Dead code CONFIG_ARMADA_39X?

Pali Rohár pali at kernel.org
Thu Mar 4 14:58:21 CET 2021


On Thursday 04 March 2021 14:50:56 Stefan Roese wrote:
> On 04.03.21 14:41, Pali Rohár wrote:
> > On Thursday 04 March 2021 14:29:46 Stefan Roese wrote:
> > > On 03.03.21 11:21, Pali Rohár wrote:
> > > > Hello!
> > > > 
> > > > I see in more U-Boot files check for ifdef CONFIG_ARMADA_39X but I do
> > > > not see that CONFIG_ARMADA_39X could be defined in some header or board
> > > > code.
> > > > 
> > > > So does it mean that all code under ifdef CONFIG_ARMADA_39X is dead? Has
> > > > U-Boot support for Marvell A39X SoC?
> > > > 
> > > > If it is really dead code, should not be ifdef CONFIG_ARMADA_39X
> > > > completely removed?
> > > 
> > > Frankly, I don't remember the history here. Did you look into the git
> > > history to see, where this Kconfig option was introduced?
> > 
> > There is no Kconfig option for ARMADA_39X.
> > 
> > Only C source files are checking if CONFIG_ARMADA_39X is defined or not.
> > But there is no code which can define CONFIG_ARMADA_39X, neither header
> > file nor Kconfig.
> > 
> > That is suspicious for me.
> 
> I agree. Thanks for looking into it.
> 
> > > It could very well be the case, that this was introduced "by accident"
> > > by including some Marvell code without taking it out. AFAIK, we are not
> > > supporting any Armada 39x in mainline right now.
> > 
> > So it looks like that somebody introduced code #ifdef CONFIG_ARMADA_39X
> > on more places "by accident".
> > 
> > For example in commit edb470253346f4a882ba9e891c8b102ce388b9cc were
> > added some these ifdefs and commit was authorized by you. So I thought
> > that you would know more...
> 
> Autsch. That was in 2015 - sorry my memory does not cover history
> that long (anymore). ;)

Ok :)

> > So if mainline U-Boot does not support Armada 39x, does it make sense to
> > remove all code hidden under CONFIG_ARMADA_39X? Following command could
> > do it:
> > 
> >    git ls-tree -r --name-only HEAD | xargs unifdef -m -UCONFIG_ARMADA_39X
> 
> I agree in general. But would it make syncing with Marvell original
> code  more difficult?

I was synchronizing only ddr3 training code for a38x. And during
synchronization I already called unifdef with tons of undef options. So
adding another one does not make it more difficult.

And about synchronizing other parts of code I have no idea if it
happened...


More information about the U-Boot mailing list