From 703f791d3538472600571ecde01627df6b47e6d6 Mon Sep 17 00:00:00 2001 From: Tomohiro Kusumi Date: Mon, 8 Apr 2019 02:18:01 +0900 Subject: [PATCH] Don't hard-code number of ioctls for portability Use (ZFS_IOC_LAST - ZFS_IOC_FIRST) instead of 256. It seems 256 is just a number large enough to hold ioctls at the moment. Using 256 also causes compile-time warning or error on platfoms whose enum zfs_ioc definition differs. Reviewed-by: Olaf Faaland Reviewed by: Brian Behlendorf Reviewed-by: Igor Kozhukhov Signed-off-by: Tomohiro Kusumi Closes #8598 --- tests/zfs-tests/cmd/libzfs_input_check/libzfs_input_check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/zfs-tests/cmd/libzfs_input_check/libzfs_input_check.c b/tests/zfs-tests/cmd/libzfs_input_check/libzfs_input_check.c index 8855a5358..977b9e2f3 100644 --- a/tests/zfs-tests/cmd/libzfs_input_check/libzfs_input_check.c +++ b/tests/zfs-tests/cmd/libzfs_input_check/libzfs_input_check.c @@ -37,7 +37,7 @@ const char *active_test; /* * Tracks which zfs_ioc_t commands were tested */ -boolean_t ioc_tested[256]; +boolean_t ioc_tested[ZFS_IOC_LAST - ZFS_IOC_FIRST]; /* * Legacy ioctls that are skipped (for now) -- 2.40.0