[U-Boot] some dead code and redundant files for nios?

Robert P. J. Day rpjday at crashcourse.ca
Sat Feb 2 00:50:14 CET 2013


  another observation about header files, this time related to
nios/nios2:

$ grep -r CONFIG_NIOS *
arch/nios2/config.mk:PLATFORM_CPPFLAGS += -DCONFIG_NIOS2 -D__NIOS2__
arch/nios2/cpu/epcs.c:#endif /* CONFIG_NIOS_EPCS */
board/psyent/common/AMDLV065D.c:#if defined(CONFIG_NIOS)  <-- ???
board/altera/common/AMDLV065D.c:#if defined(CONFIG_NIOS)  <-- ???
common/cmd_bdinfo.c:#elif defined(CONFIG_NIOS2)
examples/standalone/stubs.c:#elif defined(CONFIG_NIOS2)
$

  first, given that there is no "nios" architecture anymore, isn't
that preprocessor test of:

  #if defined(CONFIG_NIOS)

in those two files always going to be false?  the usage is:

#if defined(CONFIG_NIOS)
#include <nios.h>
#else
#include <asm/io.h>
#endif

and there *is* no nios.h file, anyway, so that pretty clearly looks
like a removable test.  more to the point, the same source file --
AMDLV065D.c -- is in two different directories, and they differ
slightly:

$ diff board/{altera,psyent}/common/AMDLV065D.c
175c175
< 		writeb (b, dst);
---
> 		writeb (dst, b);
$

  that looks kind of weird, doesn't it?  i haven't looked any more
closely but for two source files with the same name to have that
single, subtle difference just looks strange.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================


More information about the U-Boot mailing list