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>
diff --git a/common/command.c b/common/command.c
index 2c491e2..068cb55 100644
--- a/common/command.c
+++ b/common/command.c
@@ -475,13 +475,13 @@
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;