]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Use nitems(x) instead of sizeof(x)/sizeof(x[0])
authorngie <ngie@FreeBSD.org>
Mon, 2 Nov 2015 00:42:31 +0000 (00:42 +0000)
committerngie <ngie@FreeBSD.org>
Mon, 2 Nov 2015 00:42:31 +0000 (00:42 +0000)
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

tools/regression/security/open_to_operation/open_to_operation.c

index 0c65019a629a5f519b9b9319bbd76f220bfa306c..c8c816becab925836df7a52c40c1fc5b750bb67a 100644 (file)
@@ -119,10 +119,10 @@ __FBSDID("$FreeBSD$");
  */
 static const int file_modes[] = { O_RDONLY, O_WRONLY, O_RDWR,
     O_RDONLY | O_TRUNC, O_WRONLY | O_TRUNC, O_RDWR | O_TRUNC };
-static const int file_modes_count = sizeof(file_modes) / sizeof(int);
+static const int file_modes_count = nitems(file_modes);
 
 static const int dir_modes[] = { O_RDONLY };
-static const int dir_modes_count = sizeof(dir_modes) / sizeof(int);
+static const int dir_modes_count = nitems(dir_modes);
 
 static int testnum;
 static int aio_present;