summaryrefslogtreecommitdiffstats
path: root/flashrom.c
diff options
context:
space:
mode:
authorThomas Heijligen <thomas.heijligen@secunet.de>2021-05-19 14:12:18 +0200
committerNico Huber <nico.h@gmx.de>2021-06-10 12:49:28 +0000
commite14b2ec65ca6f79e02da8e1cedff5441423e9b6c (patch)
tree93277a930c180517bf766a5383cb4e33c9e7b1e0 /flashrom.c
parent4f5169df5ff2b63a40d654ab133b8a3108b6a599 (diff)
downloadflashrom-e14b2ec65ca6f79e02da8e1cedff5441423e9b6c.tar.gz
flashrom-e14b2ec65ca6f79e02da8e1cedff5441423e9b6c.tar.bz2
flashrom-e14b2ec65ca6f79e02da8e1cedff5441423e9b6c.zip
programmer_table: replace PROGRAMMER_INVALID with programmer_table_size
Change-Id: Icaaeefe001de604df9d7fdd06f05a5ed39fdbd84 Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/55117 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'flashrom.c')
-rw-r--r--flashrom.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/flashrom.c b/flashrom.c
index b804e2d4f..c036feab3 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -134,7 +134,7 @@ int programmer_init(enum programmer prog, const char *param)
{
int ret;
- if (prog >= PROGRAMMER_INVALID) {
+ if (prog >= programmer_table_size) {
msg_perr("Invalid programmer specified!\n");
return -1;
}
@@ -1585,7 +1585,7 @@ void list_programmers_linebreak(int startcol, int cols, int paren)
enum programmer p;
int i;
- for (p = 0; p < PROGRAMMER_INVALID; p++) {
+ for (p = 0; p < programmer_table_size; p++) {
pname = programmer_table[p]->name;
pnamelen = strlen(pname);
if (remaining - pnamelen - 2 < 0) {
@@ -1606,7 +1606,7 @@ void list_programmers_linebreak(int startcol, int cols, int paren)
}
msg_ginfo("%s", pname);
remaining -= pnamelen;
- if (p < PROGRAMMER_INVALID - 1) {
+ if (p < programmer_table_size - 1) {
msg_ginfo(",");
remaining--;
} else {
@@ -1715,7 +1715,7 @@ int selfcheck(void)
msg_gerr("Programmer table miscompilation!\n");
ret = 1;
}
- for (i = 0; i < PROGRAMMER_INVALID; i++) {
+ for (i = 0; i < programmer_table_size; i++) {
const struct programmer_entry *const p = programmer_table[i];
if (p == NULL) {
msg_gerr("Programmer with index %d is NULL instead of a valid pointer!\n", i);