]> git.dujemihanovic.xyz Git - u-boot.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)
commit26f923c7cff1a46d465efcd3b8f2240523c7ab08
tree6aacca0c72fc94e6c47b8b7c8fc3e18d8346791e
parent0798a1ce0f6439dfb80d310e11bc8993e09baf08
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