[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250811070548.352955-1-zhao.xichao@vivo.com>
Date: Mon, 11 Aug 2025 15:05:48 +0800
From: Xichao Zhao <zhao.xichao@...o.com>
To: ysato@...rs.sourceforge.jp,
dalias@...c.org,
glaubitz@...sik.fu-berlin.de
Cc: linux-sh@...r.kernel.org,
linux-kernel@...r.kernel.org,
Xichao Zhao <zhao.xichao@...o.com>
Subject: [PATCH] sh: intc: Use BUG_ON instead of if condition followed by BUG
BUG_ON uses unlikely in if(), it can be optimized at compile time.
Usually, the condition in if() is not satisfied. In my opinion,
this can improve the efficiency of the multi-stage pipeline.
Signed-off-by: Xichao Zhao <zhao.xichao@...o.com>
---
drivers/sh/intc/handle.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/sh/intc/handle.c b/drivers/sh/intc/handle.c
index 7863a44918a2..defa8780b566 100644
--- a/drivers/sh/intc/handle.c
+++ b/drivers/sh/intc/handle.c
@@ -128,8 +128,7 @@ static unsigned int __init _intc_prio_data(struct intc_desc *desc,
} else {
fn = REG_FN_MODIFY_BASE;
mode = MODE_PRIO_REG;
- if (!pr->set_reg)
- BUG();
+ BUG_ON(!pr->set_reg);
reg_e = pr->set_reg;
reg_d = pr->set_reg;
}
--
2.34.1
Powered by blists - more mailing lists