selftests/net: remove ARRAY_SIZE define from individual tests

ARRAY_SIZE is defined in several selftests. Remove definitions from
individual test files and include header file for the define instead.
ARRAY_SIZE define is added in a separate patch to prepare for this
change.

Remove ARRAY_SIZE from net tests and pickup the one defined in
kselftest.h.

Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
This commit is contained in:
Shuah Khan 2021-12-09 14:10:23 -07:00
parent 5a69d33b3e
commit 1329e40ebd
6 changed files with 8 additions and 11 deletions

View file

@ -7,6 +7,8 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include "../kselftest.h"
struct socket_testcase {
int domain;
int type;
@ -31,7 +33,6 @@ static struct socket_testcase tests[] = {
{ AF_INET, SOCK_STREAM, IPPROTO_UDP, -EPROTONOSUPPORT, 1 },
};
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
#define ERR_STRING_SZ 64
static int run_tests(void)