[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180907172650.29408-1-igor.stoppa@huawei.com>
Date: Fri, 7 Sep 2018 20:26:50 +0300
From: Igor Stoppa <igor.stoppa@...il.com>
To: huangdaode <huangdaode@...ilicon.com>
Cc: igor.stoppa@...il.com, Igor Stoppa <igor.stoppa@...wei.com>,
Yisen Zhuang <yisen.zhuang@...wei.com>,
Salil Mehta <salil.mehta@...wei.com>,
"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] ethernet: hnae: add unlikely() to assert()
The assert() condition is likely to be true.
Signed-off-by: Igor Stoppa <igor.stoppa@...wei.com>
Cc: huangdaode <huangdaode@...ilicon.com>
Cc: Yisen Zhuang <yisen.zhuang@...wei.com>
Cc: Salil Mehta <salil.mehta@...wei.com>
Cc: "David S. Miller" <davem@...emloft.net>
Cc: netdev@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
---
drivers/net/ethernet/hisilicon/hns/hnae.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/hisilicon/hns/hnae.h b/drivers/net/ethernet/hisilicon/hns/hnae.h
index 08a750fb60c4..bd3c180a3fe9 100644
--- a/drivers/net/ethernet/hisilicon/hns/hnae.h
+++ b/drivers/net/ethernet/hisilicon/hns/hnae.h
@@ -47,7 +47,7 @@
#ifndef assert
#define assert(expr) \
do { \
- if (!(expr)) { \
+ if (unlikely(!(expr))) { \
pr_err("Assertion failed! %s, %s, %s, line %d\n", \
#expr, __FILE__, __func__, __LINE__); \
} \
--
2.17.1
Powered by blists - more mailing lists