Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 May 2020 20:14:49 +0000 (UTC)
From:      Emmanuel Vadot <manu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r361140 - head/sys/compat/linuxkpi/common/include/linux
Message-ID:  <202005172014.04HKEnSc070578@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005172014.04HKEnSc070578>