Files
u-boot/cmd
Andy Shevchenko cbc1081da0 dfu: Avoid declaring unused variables and absent parameters
The compiler is not happy when neither USB nor TFTP transport for DFU defined:

cmd/dfu.c: In function ‘do_dfu’:
cmd/dfu.c:31:8: warning: unused variable ‘devstring’ [-Wunused-variable]
  char *devstring = argv[3];
        ^~~~~~~~~
cmd/dfu.c:30:8: warning: unused variable ‘interface’ [-Wunused-variable]
    char *interface = argv[2];
          ^~~~~~~~~

Surround those variables by #ifdef expression.

More serious, that comes under same circumstances, is a compilation error due
to absence of macro parameter:

In file included from include/image.h:45,
                 from include/common.h:35,
                 from cmd/dfu.c:13:
include/command.h:207:24: error: expected expression before ‘,’ token
 # define _CMD_HELP(x) x,
                        ^
include/command.h:286:18: note: in expansion of macro ‘_CMD_HELP’
    _cmd, _usage, _CMD_HELP(_help) _CMD_COMPLETE(_comp) }
                  ^~~~~~~~~
include/command.h:290:3: note: in expansion of macro ‘U_BOOT_CMD_MKENT_COMPLETE’
   U_BOOT_CMD_MKENT_COMPLETE(_name, _maxargs, _rep, _cmd, \
   ^~~~~~~~~~~~~~~~~~~~~~~~~
include/command.h:332:2: note: in expansion of macro ‘U_BOOT_CMD_COMPLETE’
  U_BOOT_CMD_COMPLETE(_name, _maxargs, _rep, _cmd, _usage, _help, NULL)
  ^~~~~~~~~~~~~~~~~~~
cmd/dfu.c:70:1: note: in expansion of macro ‘U_BOOT_CMD’
 U_BOOT_CMD(dfu, CONFIG_SYS_MAXARGS, 1, do_dfu,
 ^~~~~~~~~~
make[1]: *** [scripts/Makefile.build:279: cmd/dfu.o] Error 1
make: *** [Makefile:1518: cmd] Error 2

Put empty string unconditionally to have macro parameter present.

Fixes: 0f44d33536 ("dfu: Fix up the Kconfig mess")
Cc: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Lukasz Majewski <lukma@denx.de>
2019-04-21 10:26:51 +02:00
..
2017-02-08 15:56:28 -05:00
2018-08-11 09:16:08 +02:00
2017-07-03 17:35:28 -04:00
2018-05-23 17:30:05 -04:00
2018-12-04 19:44:57 +01:00
2018-09-25 21:49:18 -04:00
2019-02-19 08:55:43 -05:00
2018-09-23 21:55:30 +02:00
2019-04-12 07:04:18 +02:00
2019-04-12 07:04:18 +02:00
2017-08-16 08:30:24 -04:00
2016-10-06 20:57:42 -04:00
2018-09-28 18:27:33 +02:00
2018-11-16 16:51:56 -05:00
2018-05-08 09:07:35 -04:00
2019-03-25 17:36:53 -04:00
2019-01-15 15:28:44 -05:00
2019-01-15 15:28:44 -05:00
2019-01-15 15:28:44 -05:00
2018-09-28 20:22:36 -04:00
2019-04-12 07:04:18 +02:00
2018-07-02 14:14:20 -05:00
2019-01-15 15:28:44 -05:00