linuxkpi: Define typeof_member() in <linux/kernel.h>

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D36964
This commit is contained in:
Jean-Sébastien Pédron 2022-11-11 18:41:36 +01:00
parent 0e5569a08c
commit d3584f9283
No known key found for this signature in database
GPG Key ID: 39E99761A5FD94CC

View File

@ -577,6 +577,8 @@ kstrtou8_from_user(const char __user *s, size_t count, unsigned int base,
#define offsetofend(t, m) \
(offsetof(t, m) + sizeof((((t *)0)->m)))
#define typeof_member(s, e) typeof(((s *)0)->e)
#define clamp_t(type, _x, min, max) min_t(type, max_t(type, _x, min), max)
#define clamp(x, lo, hi) min( max(x,lo), hi)
#define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi)