misc: Use macro ARRAY_SIZE where possible

This improves readability and simplifies the code.

Cc: Anthony Liguori <aliguori@amazon.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
Stefan Weil 2013-12-07 14:48:04 +01:00 committed by Michael Tokarev
parent 2e0fc3a488
commit dff7424dc0
3 changed files with 4 additions and 5 deletions

View file

@ -856,7 +856,7 @@ static int net_host_check_device(const char *device)
,"vde"
#endif
};
for (i = 0; i < sizeof(valid_param_list) / sizeof(char *); i++) {
for (i = 0; i < ARRAY_SIZE(valid_param_list); i++) {
if (!strncmp(valid_param_list[i], device,
strlen(valid_param_list[i])))
return 1;