Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Feb 2022 00:14:59 GMT
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: e5b95b220135 - main - LinuxKPI: add sizeof_field()
Message-ID:  <202202140014.21E0Exej070014@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=e5b95b220135bba90154c9c27803f54bf1a75548

commit e5b95b220135bba90154c9c27803f54bf1a75548
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2022-02-09 11:46:15 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2022-02-14 00:13:56 +0000

    LinuxKPI: add sizeof_field()
    
    Add sizeof_field() to linux/compiler.h needed by a driver.
    
    MFC after:      3 days
    Reviewed by:    hselasky
    Differential Revision: https://reviews.freebsd.org/D34226
---
 sys/compat/linuxkpi/common/include/linux/compiler.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/compiler.h b/sys/compat/linuxkpi/common/include/linux/compiler.h
index 1f2edecbaee7..87a37228736f 100644
--- a/sys/compat/linuxkpi/common/include/linux/compiler.h
+++ b/sys/compat/linuxkpi/common/include/linux/compiler.h
@@ -111,4 +111,6 @@
 #define	__same_type(a, b)	__builtin_types_compatible_p(typeof(a), typeof(b))
 #define	__must_be_array(a)	__same_type(a, &(a)[0])
 
+#define	sizeof_field(_s, _m)	sizeof(((_s *)0)->_m)
+
 #endif	/* _LINUXKPI_LINUX_COMPILER_H_ */



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