Whamcloud - gitweb
LU-12923 libcfs: Remove CLASSERT() for libcfs_private.h 88/37188/3
authorArshad Hussain <arshad.super@gmail.com>
Mon, 30 Dec 2019 23:28:56 +0000 (04:58 +0530)
committerOleg Drokin <green@whamcloud.com>
Tue, 28 Jan 2020 06:04:19 +0000 (06:04 +0000)
This patch removes final CLASSERT() define from file
libcfs/include/libcfs/libcfs_private.h. For compile
time assertion kernel defined BUILD_BUG_ON() is preferred

Test-Parameters: trivial
Signed-off-by: Arshad Hussain <arshad.super@gmail.com>
Change-Id: I6d7dd55489824631ae61393413598fe6dc4365a2
Reviewed-on: https://review.whamcloud.com/37188
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Petros Koutoupis <pkoutoupis@cray.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Ben Evans <bevans@cray.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/include/libcfs/libcfs_private.h

index a3e2bbd..e0fcdbe 100644 (file)
@@ -346,22 +346,6 @@ do {                                                            \
 #define CFS_ALLOC_PTR(ptr)      LIBCFS_ALLOC(ptr, sizeof (*(ptr)));
 #define CFS_FREE_PTR(ptr)       LIBCFS_FREE(ptr, sizeof (*(ptr)));
 
 #define CFS_ALLOC_PTR(ptr)      LIBCFS_ALLOC(ptr, sizeof (*(ptr)));
 #define CFS_FREE_PTR(ptr)       LIBCFS_FREE(ptr, sizeof (*(ptr)));
 
-/** Compile-time assertion.
-
- * Check an invariant described by a constant expression at compile time by
- * forcing a compiler error if it does not hold.  \a cond must be a constant
- * expression as defined by the ISO C Standard:
- *
- *       6.8.4.2  The switch statement
- *       ....
- *       [#3] The expression of each case label shall be  an  integer
- *       constant   expression  and  no  two  of  the  case  constant
- *       expressions in the same switch statement shall have the same
- *       value  after  conversion...
- *
- */
-#define CLASSERT(cond) do {switch (1) {case (cond): case 0: break; } } while (0)
-
 /* implication */
 #define ergo(a, b) (!(a) || (b))
 /* logical equivalence */
 /* implication */
 #define ergo(a, b) (!(a) || (b))
 /* logical equivalence */