lkml.org 
[lkml]   [2020]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 07/23] lib/mpi: use ASSERT_FAIL()/ASSERT_WARN() to cleanup some code
Date
Since ASSERT_FAIL() and ASSERT_WARN() have been provided, ASSERT()
may be realized through them, thus reducing code redundancy and
facilitating problem analysis.

Signed-off-by: Chunguang Xu <brookxu@tencent.com>
---
lib/mpi/mpi-internal.h | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/lib/mpi/mpi-internal.h b/lib/mpi/mpi-internal.h
index 91df5f0..ee35a69 100644
--- a/lib/mpi/mpi-internal.h
+++ b/lib/mpi/mpi-internal.h
@@ -25,13 +25,8 @@
#include <linux/errno.h>

#define log_debug printk
-#define log_bug printk

-#define assert(x) \
- do { \
- if (!x) \
- log_bug("failed assertion\n"); \
- } while (0);
+#define assert(x) ASSERT_WARN(x)

/* If KARATSUBA_THRESHOLD is not already defined, define it to a
* value which is good on most machines. */
--
1.8.3.1
\
 
 \ /
  Last update: 2020-08-27 12:19    [W:0.148 / U:0.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site