Commit d5bc9607 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

greybus: loopback_test: null terminate the dict structure



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: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 6bfff1dc
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -34,7 +34,8 @@ struct dict {
static struct dict dict[] = {
	{"ping", 2},
	{"transfer", 3},
	{"sink", 4}
	{"sink", 4},
	{NULL,}		/* list termination */
};

struct loopback_results {
@@ -805,7 +806,7 @@ void loopback_run(struct loopback_test *t)
	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;
	}