From: ngie Date: Mon, 2 Nov 2015 00:42:31 +0000 (+0000) Subject: Use nitems(x) instead of sizeof(x)/sizeof(x[0]) X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=c2b5b8b86a1ea11b5c2fbf922efc1b28296eeead;p=people%2Fjulieng%2Ffreebsd.git Use nitems(x) instead of sizeof(x)/sizeof(x[0]) MFC after: 1 week Sponsored by: EMC / Isilon Storage Division --- diff --git a/tools/regression/security/open_to_operation/open_to_operation.c b/tools/regression/security/open_to_operation/open_to_operation.c index 0c65019a629a..c8c816becab9 100644 --- a/tools/regression/security/open_to_operation/open_to_operation.c +++ b/tools/regression/security/open_to_operation/open_to_operation.c @@ -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;