svn commit: r361140 - head/sys/compat/linuxkpi/common/include/linux

Emmanuel Vadot manu at FreeBSD.org
Sun May 17 20:14:50 UTC 2020


Author: manu
Date: Sun May 17 20:14:49 2020
New Revision: 361140
URL: https://svnweb.freebsd.org/changeset/base/361140

Log:
  linuxkpi: Add offsetofend macro
  
  This calculate the offset of the end of the member in the given struct.
  Needed by DRM in Linux v5.3
  
  Sponsored-by: The FreeBSD Foudation
  Differential Revision:	https://reviews.freebsd.org/D24849

Modified:
  head/sys/compat/linuxkpi/common/include/linux/kernel.h

Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/kernel.h	Sun May 17 20:12:16 2020	(r361139)
+++ head/sys/compat/linuxkpi/common/include/linux/kernel.h	Sun May 17 20:14:49 2020	(r361140)
@@ -462,6 +462,9 @@ kstrtobool_from_user(const char __user *s, size_t coun
 	type __max2 = (y);			\
 	__max1 > __max2 ? __max1 : __max2; })
 
+#define offsetofend(t, m)	\
+        (offsetof(t, m) + sizeof((((t *)0)->m)))
+
 #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)


More information about the svn-src-all mailing list