]> git.baikalelectronics.ru Git - uboot.git/commit
cli: run_commandf(): small fixups
authorEvgeny Bachinin <EABachinin@sberdevices.ru>
Mon, 20 Mar 2023 08:23:11 +0000 (11:23 +0300)
committerTom Rini <trini@konsulko.com>
Thu, 30 Mar 2023 19:09:59 +0000 (15:09 -0400)
commitfa0214cba5416f367d07131ae01c4fbafa96532a
tree6aacca0c72fc94e6c47b8b7c8fc3e18d8346791e
parente1acf35b1885fc6959beb8823d036fe2a590ad74
cli: run_commandf(): small fixups

* vsnprintf() can truncate cmd, hence it makes no sense to launch such
command (it's broken). Moreover, it's better to signalize to the caller
about such case (for facilitating debugging or bug hunting).

* Fix kernel-doc warnings:
  include/command.h:264: info: Scanning doc for run_commandf
  include/command.h:268: warning: contents before sections
  include/command.h:271: warning: No description found for return value
                                  of 'run_commandf'

* Add printf-like format attribute to validate at compile-time the format
string against parameters's type.

* Fix compilation error in case of -Wall, -Werror, -Wextra:
error: variable ā€˜iā€™ set but not used [-Werror=unused-but-set-variable]

* Drop extra ret variable.

Signed-off-by: Evgeny Bachinin <EABachinin@sberdevices.ru>
Reviewed-by: Simon Glass <sjg@chromium.org>
common/cli.c
include/command.h