command: Add constants for cmd_get_data_size string / error

At present these values are open-coded in a few places. Add constants so
the meaning is clear.

Also add a comment to cmd_get_data_size()

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2020-11-01 14:15:36 -07:00
committed by Tom Rini
parent 90a9901764
commit 7526deec7e
4 changed files with 30 additions and 6 deletions

View File

@@ -393,7 +393,7 @@ static int do_mem_search(struct cmd_tbl *cmdtp, int flag, int argc,
* Defaults to long if no or incorrect specification.
*/
size = cmd_get_data_size(argv[0], 4);
if (size < 0 && size != -2 /* string */)
if (size < 0 && size != CMD_DATA_SIZE_STR)
return 1;
argc--;