mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH linux-next] arch/ia64/kernel/module.c: fix bugon.cocci warnings
@ 2021-08-23  1:51 CGEL
  2021-08-23 19:31 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: CGEL @ 2021-08-23  1:51 UTC (permalink / raw)
  To: Gustavo A . R . Silva
  Cc: Sergei Trofimovich, Andrew Morton, linux-ia64, linux-kernel,
	Jing Yangyang, Zeal Robot

From: Jing Yangyang <jing.yangyang@zte.com.cn>

Use BUG_ON instead of a if condition followed by BUG.

Generated by: scripts/coccinelle/misc/bugon.cocci

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Jing Yangyang <jing.yangyang@zte.com.cn>
---
 arch/ia64/kernel/module.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c
index 2cba53c..f199378 100644
--- a/arch/ia64/kernel/module.c
+++ b/arch/ia64/kernel/module.c
@@ -560,8 +560,7 @@ struct plt_entry {
 	while (plt->bundle[0][0]) {
 		if (plt_target(plt) == target_ip)
 			goto found;
-		if (++plt >= plt_end)
-			BUG();
+		BUG_ON(++plt >= plt_end);
 	}
 	*plt = ia64_plt_template;
 	if (!patch_plt(mod, plt, target_ip, target_gp)) {
@@ -605,8 +604,7 @@ struct plt_entry {
 	while (fdesc->ip) {
 		if (fdesc->ip == value)
 			return (uint64_t)fdesc;
-		if ((uint64_t) ++fdesc >= mod->arch.opd->sh_addr + mod->arch.opd->sh_size)
-			BUG();
+		BUG_ON((uint64_t) ++fdesc >= mod->arch.opd->sh_addr + mod->arch.opd->sh_size);
 	}
 
 	/* Create new one */
-- 
1.8.3.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-23 19:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-23  1:51 [PATCH linux-next] arch/ia64/kernel/module.c: fix bugon.cocci warnings CGEL
2021-08-23 19:31 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®