lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 31 Aug 2018 22:24:18 +0300
From:   Igor Stoppa <igor.stoppa@...il.com>
To:     Faisal Latif <faisal.latif@...el.com>
Cc:     igor.stoppa@...il.com, Igor Stoppa <igor.stoppa@...wei.com>,
        Chien Tung <chien.tin.tung@...el.com>,
        Roland Dreier <rolandd@...co.com>,
        Jason Gunthorpe <jgg@...pe.ca>, linux-rdma@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH] infiniband: nes: add unlikely() to assert()

Typically the assert is expected to not fail.

Signed-off-by: Igor Stoppa <igor.stoppa@...wei.com>
Acked-by: Doug Ledford <dledford@...hat.com>
Cc: Faisal Latif <faisal.latif@...el.com>
Cc: Chien Tung <chien.tin.tung@...el.com>
Cc: Roland Dreier <rolandd@...co.com>
Cc: Faisal Latif <faisal.latif@...el.com>
Cc: Jason Gunthorpe <jgg@...pe.ca>
Cc: linux-rdma@...r.kernel.org
CC: linux-kernel@...r.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

Powered by blists - more mailing lists