[PATCH] sh: intc: Use BUG_ON instead of if condition followed by BUG

Xichao Zhao <[email protected]>
Newsgroups gmane.linux.ports.sh.devel,gmane.linux.kernel
Message-ID <[email protected]>
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 <[email protected]>
---
 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.