Dead code CONFIG_ARMADA_39X?

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


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.

> 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...

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


More information about the U-Boot mailing list