Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Feb 2021 23:59:13 GMT
From:      Ryan Libby <rlibby@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: bf667f282a7b - main - ofed: quiet gcc -Wint-in-bool-context
Message-ID:  <202102242359.11ONxD8B012979@gitrepo.freebsd.org>

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

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

commit bf667f282a7b98e7456d11e1cb46d9707ab8e774
Author:     Ryan Libby <rlibby@FreeBSD.org>
AuthorDate: 2021-02-24 23:56:16 +0000
Commit:     Ryan Libby <rlibby@FreeBSD.org>
CommitDate: 2021-02-24 23:56:16 +0000

    ofed: quiet gcc -Wint-in-bool-context
    
    The int in the argument to the ternary triggered -Wint-in-bool-context
    from gcc.  Upstream linux has a larger and more entangled patch,
    12f727721eee61b3d19dedb95cb893b2baa9fe41, which doesn't apply cleanly.
    When we eventually sync that, we can just drop this change.
    
    Reviewed by:    hselasky, imp, kib
    MFC after:      3 days
    Sponsored by:   Dell EMC Isilon
    Differential Revision:  https://reviews.freebsd.org/D28762
---
 sys/ofed/drivers/infiniband/core/uverbs.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sys/ofed/drivers/infiniband/core/uverbs.h b/sys/ofed/drivers/infiniband/core/uverbs.h
index 6c8d9632b0dc..0db0d47cc691 100644
--- a/sys/ofed/drivers/infiniband/core/uverbs.h
+++ b/sys/ofed/drivers/infiniband/core/uverbs.h
@@ -64,8 +64,10 @@
 
 #define INIT_UDATA_BUF_OR_NULL(udata, ibuf, obuf, ilen, olen)			\
 	do {									\
-		(udata)->inbuf  = (ilen) ? (const void __user *) (ibuf) : NULL;	\
-		(udata)->outbuf = (olen) ? (void __user *) (obuf) : NULL;	\
+		(udata)->inbuf  = ((ilen) != 0) ?				\
+		    (const void __user *) (ibuf) : NULL;			\
+		(udata)->outbuf = ((olen) != 0) ?				\
+		    (void __user *) (obuf) : NULL;				\
 		(udata)->inlen  = (ilen);					\
 		(udata)->outlen = (olen);					\
 	} while (0)



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