All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: fix bugon.cocci warnings
  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
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2020-07-17 14:43 UTC (permalink / raw)
  To: kbuild

[-- 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);

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

* [riscv:for-next 19/23] arch/riscv/mm/init.c:283:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG.
@ 2020-10-03 23:56 kernel test robot
  2020-10-03 23:56 ` [PATCH] RISC-V: fix bugon.cocci warnings kernel test robot
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2020-10-03 23:56 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1206 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>

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
config: riscv-randconfig-c004-20201002 (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>

	echo
	echo "coccinelle warnings: (new ones prefixed by >>)"
	echo
>> 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)

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 28400 bytes --]

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

* [PATCH] RISC-V: fix bugon.cocci warnings
  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
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2020-10-03 23:56 UTC (permalink / raw)
  To: kbuild

[-- 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);
 }
 

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

end of thread, other threads:[~2020-10-03 23:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH] RISC-V: fix bugon.cocci warnings kernel test robot
  -- 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: WARNING: Use BUG_ON instead of if condition followed by BUG kernel test robot
2020-07-17 14:43 ` [PATCH] RISC-V: fix bugon.cocci warnings kernel test robot

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.