From f3603b438283aa3e47b7bc564ded4b75c6ccf051 Mon Sep 17 00:00:00 2001 From: Christophe Leroy Date: Thu, 13 Jul 2017 15:09:54 +0200 Subject: powerpc: Remove unneccessary #ifdefs in reginfo reginfo command is calling mpc8xx_reginfo(), mpc85xx_reginfo() or mpc86xx_reginfo() based on CONFIG_ symbol. As those 3 functions can't me defined at the same time, let's rename them print_reginfo() to avoid the #ifdefs The name is kept generic as it is not at all dependent on powerpc arch and any other arch could want to also print such information. In addition, as the Makefile compiles cmd/reginfo.c only when CONFIG_CMD_REGINFO is set, there is no need to enclose the U_BOOT_CMD definition inside a #ifdef CONFIG_CMD_REGINFO Lets all remove the #ifdefs around the U_BOOT_CMD as this file is only compiled when CONFIG_CMD_REGINFO is defined Finally, this is a PowerPC-only command, disable it on a number of non-PowerPC platforms. Signed-off-by: Christophe Leroy Signed-off-by: Tom Rini --- cmd/reginfo.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'cmd') diff --git a/cmd/reginfo.c b/cmd/reginfo.c index b364cc899a..b23883e4bf 100644 --- a/cmd/reginfo.c +++ b/cmd/reginfo.c @@ -7,36 +7,20 @@ #include #include -#if defined(CONFIG_8xx) -void mpc8xx_reginfo(void); -#elif defined(CONFIG_MPC86xx) -extern void mpc86xx_reginfo(void); -#elif defined(CONFIG_MPC85xx) -extern void mpc85xx_reginfo(void); -#endif +#include static int do_reginfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { -#if defined(CONFIG_8xx) - mpc8xx_reginfo(); - -#elif defined(CONFIG_MPC86xx) - mpc86xx_reginfo(); - -#elif defined(CONFIG_MPC85xx) - mpc85xx_reginfo(); -#endif + print_reginfo(); return 0; } /**************************************************/ -#if defined(CONFIG_CMD_REGINFO) U_BOOT_CMD( reginfo, 2, 1, do_reginfo, "print register information", "" ); -#endif -- cgit