diff options
author | Greg Kroah-Hartman <gregkh@google.com> | 2015-12-15 13:57:22 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2015-12-17 18:17:07 -0800 |
commit | d5bc9607f749a241b2491f8f8b07986ba7655350 (patch) | |
tree | b3c16a0326fc28affefd156ff8886ae370d75539 /drivers/staging/greybus/tools | |
parent | 6bfff1dcb2766ebef60a288601ff4cccbb1f6e54 (diff) | |
download | op-kernel-dev-d5bc9607f749a241b2491f8f8b07986ba7655350.zip op-kernel-dev-d5bc9607f749a241b2491f8f8b07986ba7655350.tar.gz |
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: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/tools')
-rw-r--r-- | drivers/staging/greybus/tools/loopback_test.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/greybus/tools/loopback_test.c b/drivers/staging/greybus/tools/loopback_test.c index 5c2a9fc..27c733d 100644 --- a/drivers/staging/greybus/tools/loopback_test.c +++ b/drivers/staging/greybus/tools/loopback_test.c @@ -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; } |