[RTEMS Project] #4150: Delete or fix shell command fdt (rtems-fdt.c is dead code)

RTEMS trac trac at rtems.org
Thu Oct 15 15:08:44 UTC 2020

#4150: Delete or fix shell command fdt (rtems-fdt.c is dead code)
  Reporter:  Frank Kuehndel  |      Owner:  (none)
      Type:  enhancement     |     Status:  assigned
  Priority:  low             |  Milestone:  Indefinite
 Component:  shell           |    Version:
  Severity:  normal          |   Keywords:  shell, fdt
Blocked By:                  |   Blocking:
 The shell seems to once have a command 'fdt' (flattened device tree). Its
 code resides in


 At the time of writing, this code is not used. No code calls this and it
 is not part of the shell anymore. It is not even listed in the shell
 command macros in cpukit/include/rtems/shellconfig.h.

 Note that RTEMS has a large set of fdt functions which are also used - in
 cpukit/include/libfdt.h. Yet, these are not a shell command.

 I tried to test the 'fdt' shell command but loading the flattened device
 tree blob from testsuites/libtests/libfdt01/some.c (see
 testsuites/libtests/libfdt01/some.dts) with 'fdt ld <blob-filename>'
 resulted in an infinite loop. Yet, maybe I made something wrong. (RTEMS 6,
 HEAD at df9cc1aee87da6c6ba41d52454fa5f45fba74501,

 See also bug #3156 "rtems-fdt probably not supported on 64-bit PowerPC"

 I suggest to either fix this code and make it a working shell command
 again (by for example replacing the functions in rtems-fdt.c by those from
 libfdt.h) or to delete the dead code.

 Why not simply letting dead code hang around in the sources?

 Because even dead code needs maintenance. New compiler versions, compiler
 flags, code analysis tools etc. report warnings or errors even in dead
 code and these issues must be fixed and - if possible - tested. Moreover,
 some dead code (not 'rtems-fdt.c') uses internals from other "living"
 RTEMS code. If that living code is changed, the dead code needs to be
 adapted to these changes. Conclusion: Dead code wastes efforts and makes
 maintenance harder.

Ticket URL: <http://devel.rtems.org/ticket/4150>
RTEMS Project <http://www.rtems.org/>
RTEMS Project

More information about the bugs mailing list