All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [PATCH] RISC-V: fix bugon.cocci warnings
Date: Sun, 04 Oct 2020 07:56:42 +0800	[thread overview]
Message-ID: <20201003235642.GA29983@489b4183b66a> (raw)
In-Reply-To: <202010040742.cpWCl5VQ-lkp@intel.com>

[-- Attachment #1: Type: text/plain, Size: 2045 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Atish Patra <atish.patra@wdc.com>
CC: Palmer Dabbelt <palmerdabbelt@google.com>
CC: Anup Patel <anup@brainfault.org>
CC: Paul Walmsley <paul.walmsley@sifive.com>
CC: Albert Ou <aou@eecs.berkeley.edu>
CC: Zong Li <zong.li@sifive.com>
CC: Mike Rapoport <rppt@kernel.org>
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:283:2-5: 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: e8dcb61f2ade ("RISC-V: Implement late mapping page table allocation functions")
CC: Atish Patra <atish.patra@wdc.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git for-next
head:   de22d2107ced3cc5355cc9dbbd85e44183546bd5
commit: e8dcb61f2ade040a372d66907d220dd3fdee2505 [19/23] RISC-V: Implement late mapping page table allocation functions
:::::: branch date: 26 hours ago
:::::: commit date: 26 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
@@ -279,8 +279,7 @@ static phys_addr_t alloc_pte_late(uintpt
 	unsigned long vaddr;
 
 	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);
 }
 

  reply	other threads:[~2020-10-03 23:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-03 23:56 [riscv:for-next 19/23] arch/riscv/mm/init.c:283:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG kernel test robot
2020-10-03 23:56 ` kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-07-17 14:43 [atishp04:uefi_riscv_5.9_v3 16/22] arch/riscv/mm/init.c:258:3-6: " kernel test robot
2020-07-17 14:43 ` [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=20201003235642.GA29983@489b4183b66a \
    --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.