This lets us test for any number of entries, no need to do an
ARRAY_SIZE-type comparison. This fixes a build warning of comparing
signed/unsigned values.)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
static struct dict dict[] = {
{"ping", 2},
{"transfer", 3},
- {"sink", 4}
+ {"sink", 4},
+ {NULL,} /* list termination */
};
struct loopback_results {
int i;
int ret;
- for (i = 0; i < sizeof(dict) / sizeof(struct dict); i++) {
+ for (i = 0; dict[i].name != NULL; i++) {
if (strstr(dict[i].name, t->test_name))
t->test_id = dict[i].type;
}