Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 May 2022 15:57:14 GMT
From:      Alex Richardson <arichardson@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 763198cc5086 - stable/13 - linuxkpi: Allow BUILD_BUG_ON in if statements without braces
Message-ID:  <202205071557.247FvEdu015035@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by arichardson:

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

commit 763198cc50865e419efca0060f4620b601786929
Author:     Alex Richardson <arichardson@FreeBSD.org>
AuthorDate: 2021-10-08 08:35:31 +0000
Commit:     Alex Richardson <arichardson@FreeBSD.org>
CommitDate: 2022-05-07 12:08:46 +0000

    linuxkpi: Allow BUILD_BUG_ON in if statements without braces
    
    I got a compilation failure in virtio-gpu without this change.
    
    Reviewed By:    #linuxkpi, manu, bz, hselasky
    Differential Revision: https://reviews.freebsd.org/D32366
    
    (cherry picked from commit 6d15ccde4d9579ad2a77f93630695804a7efcbc4)
---
 sys/compat/linuxkpi/common/include/linux/kernel.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h
index c22a711a4f47..51f2ffe01e15 100644
--- a/sys/compat/linuxkpi/common/include/linux/kernel.h
+++ b/sys/compat/linuxkpi/common/include/linux/kernel.h
@@ -105,7 +105,7 @@
 }
 
 #define	BUILD_BUG()			do { CTASSERT(0); } while (0)
-#define	BUILD_BUG_ON(x)			_O_CTASSERT(!(x))
+#define	BUILD_BUG_ON(x)			do { _O_CTASSERT(!(x)) } while (0)
 #define	BUILD_BUG_ON_MSG(x, msg)	BUILD_BUG_ON(x)
 #define	BUILD_BUG_ON_NOT_POWER_OF_2(x)	BUILD_BUG_ON(!powerof2(x))
 #define	BUILD_BUG_ON_INVALID(expr)	while (0) { (void)(expr); }



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