lkml.org 
[lkml]   [2018]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] infiniband: nes: add unlikely() to assert()
Date
Typically the assert is expected to not fail.

Signed-off-by: Igor Stoppa <igor.stoppa@huawei.com>
Acked-by: Doug Ledford <dledford@redhat.com>
Cc: Faisal Latif <faisal.latif@intel.com>
Cc: Chien Tung <chien.tin.tung@intel.com>
Cc: Roland Dreier <rolandd@cisco.com>
Cc: Faisal Latif <faisal.latif@intel.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: linux-rdma@vger.kernel.org
CC: linux-kernel@vger.kernel.org
---
drivers/infiniband/hw/nes/nes.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/nes/nes.h b/drivers/infiniband/hw/nes/nes.h
index bedaa02749fb..d2d0098f38e0 100644
--- a/drivers/infiniband/hw/nes/nes.h
+++ b/drivers/infiniband/hw/nes/nes.h
@@ -151,7 +151,7 @@ do { \

#define assert(expr) \
do { \
- if (!(expr)) { \
+ if (unlikely(!(expr))) { \
printk(KERN_ERR PFX "Assertion failed! %s, %s, %s, line %d\n", \
#expr, __FILE__, __func__, __LINE__); \
} \
--
2.17.1
\
 
 \ /
  Last update: 2018-08-31 21:25    [W:0.068 / U:0.660 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site