aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElyes Haouas <ehaouas@noos.fr>2023-11-07 17:14:45 +0000
committerWarner Losh <imp@FreeBSD.org>2024-04-29 03:30:55 +0000
commitb561d8f59c7de56f5da576530961aaeea2d89875 (patch)
tree0043ac91998fd6ce84d78f107d9bf7bce0f48a8f
parentcbfd42cc07cc1b684a1d512e1265a1cd5e47e677 (diff)
downloadsrc-b561d8f59c7de56f5da576530961aaeea2d89875.tar.gz
src-b561d8f59c7de56f5da576530961aaeea2d89875.zip
zonectl: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
-rw-r--r--usr.sbin/zonectl/zonectl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/zonectl/zonectl.c b/usr.sbin/zonectl/zonectl.c
index 56cd3c436d10..53e5e6599597 100644
--- a/usr.sbin/zonectl/zonectl.c
+++ b/usr.sbin/zonectl/zonectl.c
@@ -32,8 +32,8 @@
#include <sys/cdefs.h>
#include <sys/ioctl.h>
+#include <sys/param.h>
#include <sys/stdint.h>
-#include <sys/types.h>
#include <sys/endian.h>
#include <sys/sbuf.h>
#include <sys/queue.h>
@@ -401,7 +401,7 @@ main(int argc, char **argv)
int entry_num;
status = scsi_get_nv(zone_cmd_map,
- (sizeof(zone_cmd_map) / sizeof(zone_cmd_map[0])),
+ nitems(zone_cmd_map),
optarg, &entry_num, SCSI_NV_FLAG_IG_CASE);
if (status == SCSI_NV_FOUND)
action = zone_cmd_map[entry_num].value;