+/**
+ * cast_if_any - only cast an expression if it is one of the three given types
+ * @desttype: the type to cast to
+ * @expr: the expression to cast
+ * @ok1: the first type we allow
+ * @ok2: the second type we allow
+ * @ok3: the third type we allow
+ *
+ * This is a convenient wrapper for multiple cast_if_type() calls. You can
+ * chain them inside each other (ie. use cast_if_any() for expr) if you need
+ * more than 3 arguments.
+ *
+ * Example:
+ * // We can take either a long, unsigned long, void * or a const void *.
+ * void _set_some_value(void *val);
+ * #define set_some_value(expr) \
+ * _set_some_value(cast_if_any(void *, (expr), \
+ * long, unsigned long, const void *))
+ */
+#define cast_if_any(desttype, expr, ok1, ok2, ok3) \
+ cast_if_type(desttype, \
+ cast_if_type(desttype, \
+ cast_if_type(desttype, (expr), ok1), \
+ ok2), \
+ ok3)
+