Commit b352fc80 authored by Marek Vasut's avatar Marek Vasut

mxssb: Use ARRAY_SIZE for the modetable

Use the ARRAY_SIZE macro consistently for the SB MODE command
table of options.
Signed-off-by: Marek Vasut's avatarMarek Vasut <marex@denx.de>
parent 3afa6fbb
......@@ -1007,7 +1007,7 @@ static int sb_build_command_mode(struct sb_image_ctx *ictx, struct sb_cmd_list *
goto err;
}
for (i = 0; i < sizeof(modetable)/sizeof(modetable[0]); i++) {
for (i = 0; i < ARRAY_SIZE(modetable); i++) {
if (!strcmp(tok, modetable[i].name)) {
mode = modetable[i].mode;
break;
......@@ -1551,7 +1551,7 @@ static int sb_verify_command(struct sb_image_ctx *ictx,
flag, ccmd->fill.address, ccmd->jump.argument, csum);
return 0;
case ROM_MODE_CMD:
for (i = 0; i < sizeof(modetable)/sizeof(modetable[0]); i++) {
for (i = 0; i < ARRAY_SIZE(modetable); i++) {
if (ccmd->mode.mode == modetable[i].mode) {
fprintf(stdout, " MODE %s # %s\n",
modetable[i].name, csum);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment