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-12-01 10:33:38 -05:00
committed by Tom Rini
parent 90a9901764
commit 7526deec7e
4 changed files with 30 additions and 6 deletions
+2 -2
View File
@@ -475,13 +475,13 @@ int cmd_get_data_size(char* arg, int default_size)
case 'l':
return 4;
case 's':
return -2;
return CMD_DATA_SIZE_STR;
case 'q':
if (MEM_SUPPORT_64BIT_DATA)
return 8;
/* no break */
default:
return -1;
return CMD_DATA_SIZE_ERR;
}
}
return default_size;