summaryrefslogtreecommitdiff
path: root/kernel/include/containter_of.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/include/containter_of.h')
-rw-r--r--kernel/include/containter_of.h20
1 files changed, 0 insertions, 20 deletions
diff --git a/kernel/include/containter_of.h b/kernel/include/containter_of.h
index 9cadd91..9672988 100644
--- a/kernel/include/containter_of.h
+++ b/kernel/include/containter_of.h
@@ -5,7 +5,6 @@
#define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
#define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
-#define typeof_member(T, m) typeof(((T *)0)->m)
/**
* container_of - cast a member of a structure out to the containing structure
@@ -23,23 +22,4 @@
((type *)(__mptr - offsetof(type, member))); \
})
-/**
- * container_of_safe - cast a member of a structure out to the containing structure
- * @ptr: the pointer to the member.
- * @type: the type of the container struct this is embedded in.
- * @member: the name of the member within the struct.
- *
- * If IS_ERR_OR_NULL(ptr), ptr is returned unchanged.
- */
-#define container_of_safe(ptr, type, member) \
- ({ \
- void *__mptr = (void *)(ptr); \
- static_assert(__same_type(*(ptr), ((type *)0)->member) || \
- __same_type(*(ptr), void), \
- "pointer type mismatch in container_of_safe()"); \
- IS_ERR_OR_NULL(__mptr) ? \
- ERR_CAST(__mptr) : \
- ((type *)(__mptr - offsetof(type, member))); \
- })
-
#endif