summaryrefslogtreecommitdiff
path: root/include/linux/array_size.h
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2023-10-16 22:00:13 +0200
committerLinus Walleij <linus.walleij@linaro.org>2023-10-16 22:00:13 +0200
commit593bcf6889de542aec1aeab7de6db25a1ff37408 (patch)
tree0661f23ec6c070539005c86ef38ab89f066d1eb8 /include/linux/array_size.h
parent30d75d3c6fe7cba7f1641e89d2b65de657932a19 (diff)
parent8d751da9f1d790f1d5e4b109eb0ad4a366d5efc8 (diff)
Merge tag 'intel-pinctrl-v6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel into devel
intel-pinctrl for v6.7-1 * Merge "Drop runtime PM support for Baytrail and Lynxpoint pinctrl" (Raag) * Small improvements here and there in the Intel pin control drivers (Raag) * Switch to RAII for locking in the Intel core and Cherry View drivers * Enable non-ACPI enumeration in the Intel Denverton driver * Use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS() in a couple of drivers * Introduce array_size.h and use in in the Intel pin control drivers The following is an automated git shortlog grouped by driver: baytrail: - Replace kernel.h by what is actually being used - drop runtime PM support - fix debounce disable case broxton: - Replace MODULE_ALIAS() with MODULE_DEVICE_TABLE() cherryview: - reduce scope of PIN_CONFIG_BIAS_HIGH_IMPEDANCE case - Convert to platform remove callback returning void - Simplify code with cleanup helpers - Avoid duplicated I/O - Replace kernel.h by what is actually being used denverton: - Replace MODULE_ALIAS() with MODULE_DEVICE_TABLE() - Enable platform device in the absence of ACPI enumeration intel: - fetch community only when we need it - refine intel_config_set_pull() function - Replace kernel.h by what is actually being used - Simplify code with cleanup helpers lynxpoint: - Replace kernel.h by what is actually being used - drop runtime PM support merrifield: - Replace kernel.h by what is actually being used moorefield: - Replace kernel.h by what is actually being used Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'include/linux/array_size.h')
-rw-r--r--include/linux/array_size.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/array_size.h b/include/linux/array_size.h
new file mode 100644
index 000000000000..06d7d83196ca
--- /dev/null
+++ b/include/linux/array_size.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_ARRAY_SIZE_H
+#define _LINUX_ARRAY_SIZE_H
+
+#include <linux/compiler.h>
+
+/**
+ * ARRAY_SIZE - get the number of elements in array @arr
+ * @arr: array to be sized
+ */
+#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
+
+#endif /* _LINUX_ARRAY_SIZE_H */