From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [PATCH] RISC-V: fix bugon.cocci warnings
Date: Fri, 17 Jul 2020 22:43:08 +0800 [thread overview]
Message-ID: <20200717144308.GA116177@f2f7d3bee6c7> (raw)
In-Reply-To: <202007172235.Fu1yWDZQ%lkp@intel.com>
[-- Attachment #1: Type: text/plain, Size: 2064 bytes --]
CC: kbuild-all(a)lists.01.org
TO: Atish Patra <atish.patra@wdc.com>
CC: Paul Walmsley <paul.walmsley@sifive.com>
CC: Palmer Dabbelt <palmer@dabbelt.com>
CC: Albert Ou <aou@eecs.berkeley.edu>
CC: Anup Patel <anup.patel@wdc.com>
CC: Zong Li <zong.li@sifive.com>
CC: Mike Rapoport <rppt@linux.ibm.com>
CC: Kefeng Wang <wangkefeng.wang@huawei.com>
CC: Yash Shah <yash.shah@sifive.com>
CC: linux-riscv(a)lists.infradead.org
From: kernel test robot <lkp@intel.com>
arch/riscv/mm/init.c:258:3-6: WARNING: Use BUG_ON instead of if condition followed by BUG.
Please make sure the condition has no side effects (see conditional BUG_ON definition in include/asm-generic/bug.h)
Use BUG_ON instead of a if condition followed by BUG.
Semantic patch information:
This makes an effort to find cases where BUG() follows an if
condition on an expression and replaces the if condition and BUG()
with a BUG_ON having the conditional expression of the if statement
as argument.
Generated by: scripts/coccinelle/misc/bugon.cocci
Fixes: 4f1b8699833b ("RISC-V: Implement late mapping page table allocation functions")
Signed-off-by: kernel test robot <lkp@intel.com>
---
tree: https://github.com/atishp04/linux uefi_riscv_5.9_v3
head: 6704b94c1a532f3c8d8fcdb9db87313a87350ec8
commit: 4f1b8699833b26397b5667e74d8bce5f12c487eb [16/22] RISC-V: Implement late mapping page table allocation functions
:::::: branch date: 15 hours ago
:::::: commit date: 15 hours ago
Please take the patch only if it's a positive warning. Thanks!
init.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -254,8 +254,7 @@ static phys_addr_t __init alloc_pte(uint
BUG_ON(!mmu_enabled);
if (late_mapping) {
vaddr = __get_free_page(GFP_KERNEL);
- if (!vaddr || !pgtable_pte_page_ctor(virt_to_page(vaddr)))
- BUG();
+ BUG_ON(!vaddr || !pgtable_pte_page_ctor(virt_to_page(vaddr)));
return __pa(vaddr);
} else
return memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE);
next prev parent reply other threads:[~2020-07-17 14:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-17 14:43 [atishp04:uefi_riscv_5.9_v3 16/22] arch/riscv/mm/init.c:258:3-6: WARNING: Use BUG_ON instead of if condition followed by BUG kernel test robot
2020-07-17 14:43 ` kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-10-03 23:56 [riscv:for-next 19/23] arch/riscv/mm/init.c:283:2-5: " kernel test robot
2020-10-03 23:56 ` [PATCH] RISC-V: fix bugon.cocci warnings kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200717144308.GA116177@f2f7d3bee6c7 \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.