aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linuxkpi/common/include/linux/array_size.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/compat/linuxkpi/common/include/linux/array_size.h')
-rw-r--r--sys/compat/linuxkpi/common/include/linux/array_size.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/array_size.h b/sys/compat/linuxkpi/common/include/linux/array_size.h
new file mode 100644
index 000000000000..ebfaeccc9536
--- /dev/null
+++ b/sys/compat/linuxkpi/common/include/linux/array_size.h
@@ -0,0 +1,17 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2010 Isilon Systems, Inc.
+ * Copyright (c) 2010 iX Systems, Inc.
+ * Copyright (c) 2010 Panasas, Inc.
+ * All rights reserved.
+ */
+
+#ifndef _LINUXKPI_LINUX_ARRAY_SIZE_H_
+#define _LINUXKPI_LINUX_ARRAY_SIZE_H_
+
+#include <linux/compiler.h>
+
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+
+#endif /* _LINUXKPI_LINUX_ARRAY_SIZE_H_ */