lkml.org 
[lkml]   [2021]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH linux-next] power:pkeys: fix bugon.cocci warnings
Date
From: Jing Yangyang <jing.yangyang@zte.com.cn>

Use BUG_ON instead of a if condition followed by BUG.

./arch/powerpc/include/asm/book3s/64/pkeys.h:21:2-5:WARNING
Use BUG_ON instead of if condition followed by BUG.
./arch/powerpc/include/asm/book3s/64/pkeys.h:14:2-5:WARNING
Use BUG_ON instead of 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/powerpc/include/asm/book3s/64/pkeys.h | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/include/asm/book3s/64/pkeys.h b/arch/powerpc/include/asm/book3s/64/pkeys.h
index 5b17813..5f74f0c 100644
--- a/arch/powerpc/include/asm/book3s/64/pkeys.h
+++ b/arch/powerpc/include/asm/book3s/64/pkeys.h
@@ -10,15 +10,13 @@ static inline u64 vmflag_to_pte_pkey_bits(u64 vm_flags)
if (!mmu_has_feature(MMU_FTR_PKEY))
return 0x0UL;

- if (radix_enabled())
- BUG();
+ BUG_ON(radix_enabled());
return hash__vmflag_to_pte_pkey_bits(vm_flags);
}

static inline u16 pte_to_pkey_bits(u64 pteflags)
{
- if (radix_enabled())
- BUG();
+ BUG_ON(radix_enabled());
return hash__pte_to_pkey_bits(pteflags);
}

--
1.8.3.1

\
 
 \ /
  Last update: 2021-08-25 08:44    [W:0.086 / U:3.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site