aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2017-02-02 12:26:51 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-02-02 13:03:04 +0100
commitf440d909085e497540788fecc056dc39ea0471ed (patch)
treec2100604c07c552f8cbb05a8a60a99f0462d0c31 /drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c
parentstaging: bcm2835: mark all symbols as 'static' (diff)
downloadlinux-dev-f440d909085e497540788fecc056dc39ea0471ed.tar.xz
linux-dev-f440d909085e497540788fecc056dc39ea0471ed.zip
staging: lustre: remove CLASSERT macro
lustre uses a fake switch() statement as a compile-time assert, but unfortunately each use of that causes a warning when building with clang: drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:2907:2: warning: no case matching constant switch condition '42' drivers/staging/lustre/lnet/klnds/socklnd/../../../include/linux/libcfs/libcfs_private.h:294:36: note: expanded from macro 'CLASSERT' #define CLASSERT(cond) do {switch (42) {case (cond): case 0: break; } } while (0) As Greg suggested, let's just kill off this macro completely instead of fixing it. This replaces it with BUILD_BUG_ON(), which means we have to negate all the conditions in the process. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c')
-rw-r--r--drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c
index b36f181db08e..d367e74d46c2 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c
@@ -464,7 +464,7 @@ ksocknal_send_hello_v1(struct ksock_conn *conn, ksock_hello_msg_t *hello)
int rc;
int i;
- CLASSERT(sizeof(struct lnet_magicversion) == offsetof(struct lnet_hdr, src_nid));
+ BUILD_BUG_ON(sizeof(struct lnet_magicversion) != offsetof(struct lnet_hdr, src_nid));
LIBCFS_ALLOC(hdr, sizeof(*hdr));
if (!hdr) {