All of lore.kernel.org
 help / color / mirror / Atom feed
* [aa:master 33/37] mm/huge_memory.c:2062:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG.
@ 2021-05-07  3:40 kernel test robot
  2021-05-07  3:40 ` [PATCH] userfaultfd: fix bugon.cocci warnings kernel test robot
  0 siblings, 1 reply; 8+ messages in thread
From: kernel test robot @ 2021-05-07  3:40 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
TO: Andrea Arcangeli <aarcange@redhat.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/andrea/aa.git master
head:   231327dd5f394c1d032155b7819eeca9e0efe5fd
commit: 02c0714c4e4f79be9c34d6a7b3614f86f2967210 [33/37] userfaultfd: UFFDIO_REMAP uABI
:::::: branch date: 4 hours ago
:::::: commit date: 4 hours ago
config: x86_64-randconfig-c002-20210506 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 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>


cocci warnings: (new ones prefixed by >>)
>> mm/huge_memory.c:2062: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: 31852 bytes --]

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

* [PATCH] userfaultfd: fix bugon.cocci warnings
  2021-05-07  3:40 [aa:master 33/37] mm/huge_memory.c:2062:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG kernel test robot
@ 2021-05-07  3:40 ` kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-05-07  3:40 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
TO: Andrea Arcangeli <aarcange@redhat.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

mm/huge_memory.c:2062: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: 02c0714c4e4f ("userfaultfd: UFFDIO_REMAP uABI")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/andrea/aa.git master
head:   231327dd5f394c1d032155b7819eeca9e0efe5fd
commit: 02c0714c4e4f79be9c34d6a7b3614f86f2967210 [33/37] userfaultfd: UFFDIO_REMAP uABI
:::::: branch date: 4 hours ago
:::::: commit date: 4 hours ago

Please take the patch only if it's a positive warning. Thanks!

 huge_memory.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -2057,9 +2057,7 @@ int remap_pages_huge_pmd(struct mm_struc
 	WRITE_ONCE(src_page->mapping, (struct address_space *) dst_anon_vma);
 	WRITE_ONCE(src_page->index, linear_page_index(dst_vma, dst_addr));
 
-	if (!pmd_same(pmdp_huge_clear_flush(src_vma, src_addr, src_pmd),
-		      src_pmdval))
-		BUG();
+	BUG_ON(!pmd_same(pmdp_huge_clear_flush(src_vma, src_addr, src_pmd), src_pmdval));
 	_dst_pmd = mk_huge_pmd(src_page, dst_vma->vm_page_prot);
 	_dst_pmd = maybe_pmd_mkwrite(pmd_mkdirty(_dst_pmd), dst_vma);
 	set_pmd_at(dst_mm, dst_addr, dst_pmd, _dst_pmd);

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

* [PATCH] userfaultfd: fix bugon.cocci warnings
@ 2021-12-23  2:47 kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-12-23  2:47 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Andrea Arcangeli <aarcange@redhat.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

mm/userfaultfd.c:865: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)
mm/userfaultfd.c:917: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: f656fca095ea ("userfaultfd: UFFDIO_REMAP uABI")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/andrea/aa.git main
head:   e37fc15fcde08ff18027c1a1e34b2371ac2c449b
commit: f656fca095eaa2bc257fee306e02c92f229031c9 [38/50] userfaultfd: UFFDIO_REMAP uABI
:::::: branch date: 23 hours ago
:::::: commit date: 23 hours ago

Please take the patch only if it's a positive warning. Thanks!

 userfaultfd.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

--- a/mm/userfaultfd.c
+++ b/mm/userfaultfd.c
@@ -860,9 +860,7 @@ static int remap_pages_pte(struct mm_str
 		WRITE_ONCE(src_page->index, linear_page_index(dst_vma,
 							      dst_addr));
 
-		if (!pte_same(ptep_clear_flush(src_vma, src_addr, src_pte),
-			      orig_src_pte))
-			BUG();
+		BUG_ON(!pte_same(ptep_clear_flush(src_vma, src_addr, src_pte), orig_src_pte));
 
 		orig_dst_pte = mk_pte(src_page, dst_vma->vm_page_prot);
 		orig_dst_pte = maybe_mkwrite(pte_mkdirty(orig_dst_pte),
@@ -912,9 +910,7 @@ static int remap_pages_pte(struct mm_str
 			return -EAGAIN;
 		}
 
-		if (pte_val(ptep_get_and_clear(src_mm, src_addr, src_pte)) !=
-		    pte_val(orig_src_pte))
-			BUG();
+		BUG_ON(pte_val(ptep_get_and_clear(src_mm, src_addr, src_pte)) != pte_val(orig_src_pte));
 		set_pte_at(dst_mm, dst_addr, dst_pte, orig_src_pte);
 
 		if (dst_mm != src_mm) {

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

* [PATCH] userfaultfd: fix bugon.cocci warnings
@ 2021-12-23  2:47 kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-12-23  2:47 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Andrea Arcangeli <aarcange@redhat.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

mm/huge_memory.c:1987: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: f656fca095ea ("userfaultfd: UFFDIO_REMAP uABI")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/andrea/aa.git main
head:   e37fc15fcde08ff18027c1a1e34b2371ac2c449b
commit: f656fca095eaa2bc257fee306e02c92f229031c9 [38/50] userfaultfd: UFFDIO_REMAP uABI
:::::: branch date: 23 hours ago
:::::: commit date: 23 hours ago

Please take the patch only if it's a positive warning. Thanks!

 huge_memory.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1982,9 +1982,7 @@ int remap_pages_huge_pmd(struct mm_struc
 	WRITE_ONCE(src_page->mapping, (struct address_space *) dst_anon_vma);
 	WRITE_ONCE(src_page->index, linear_page_index(dst_vma, dst_addr));
 
-	if (!pmd_same(pmdp_huge_clear_flush(src_vma, src_addr, src_pmd),
-		      src_pmdval))
-		BUG();
+	BUG_ON(!pmd_same(pmdp_huge_clear_flush(src_vma, src_addr, src_pmd), src_pmdval));
 	_dst_pmd = mk_huge_pmd(src_page, dst_vma->vm_page_prot);
 	_dst_pmd = maybe_pmd_mkwrite(pmd_mkdirty(_dst_pmd), dst_vma);
 	set_pmd_at(dst_mm, dst_addr, dst_pmd, _dst_pmd);

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

* [PATCH] userfaultfd: fix bugon.cocci warnings
  2021-09-20 18:53 [andrea-aa:main 34/39] mm/userfaultfd.c:866:3-6: WARNING: Use BUG_ON instead of if condition followed by BUG kernel test robot
@ 2021-09-20 18:53 ` kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-09-20 18:53 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Andrea Arcangeli <aarcange@redhat.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

mm/userfaultfd.c:866: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)
mm/userfaultfd.c:918: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: 9c170f87bcd5 ("userfaultfd: UFFDIO_REMAP uABI")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/andrea/aa.git main
head:   594ac4d4703392f80b124eebc2e2816ded6b92cf
commit: 9c170f87bcd588d29b1c0588f50d089041b0b1ef [34/39] userfaultfd: UFFDIO_REMAP uABI
:::::: branch date: 3 days ago
:::::: commit date: 3 days ago

Please take the patch only if it's a positive warning. Thanks!

 userfaultfd.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

--- a/mm/userfaultfd.c
+++ b/mm/userfaultfd.c
@@ -861,9 +861,7 @@ static int remap_pages_pte(struct mm_str
 		WRITE_ONCE(src_page->index, linear_page_index(dst_vma,
 							      dst_addr));
 
-		if (!pte_same(ptep_clear_flush(src_vma, src_addr, src_pte),
-			      orig_src_pte))
-			BUG();
+		BUG_ON(!pte_same(ptep_clear_flush(src_vma, src_addr, src_pte), orig_src_pte));
 
 		orig_dst_pte = mk_pte(src_page, dst_vma->vm_page_prot);
 		orig_dst_pte = maybe_mkwrite(pte_mkdirty(orig_dst_pte),
@@ -913,9 +911,7 @@ static int remap_pages_pte(struct mm_str
 			return -EAGAIN;
 		}
 
-		if (pte_val(ptep_get_and_clear(src_mm, src_addr, src_pte)) !=
-		    pte_val(orig_src_pte))
-			BUG();
+		BUG_ON(pte_val(ptep_get_and_clear(src_mm, src_addr, src_pte)) != pte_val(orig_src_pte));
 		set_pte_at(dst_mm, dst_addr, dst_pte, orig_src_pte);
 
 		if (dst_mm != src_mm) {

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

* [PATCH] userfaultfd: fix bugon.cocci warnings
  2021-05-07  2:49 [aa:master 33/37] mm/userfaultfd.c:831:3-6: WARNING: Use BUG_ON instead of if condition followed by BUG kernel test robot
@ 2021-05-07  2:49 ` kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-05-07  2:49 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
TO: Andrea Arcangeli <aarcange@redhat.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

mm/userfaultfd.c:831: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)
mm/userfaultfd.c:883: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: 02c0714c4e4f ("userfaultfd: UFFDIO_REMAP uABI")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/andrea/aa.git master
head:   231327dd5f394c1d032155b7819eeca9e0efe5fd
commit: 02c0714c4e4f79be9c34d6a7b3614f86f2967210 [33/37] userfaultfd: UFFDIO_REMAP uABI
:::::: branch date: 4 hours ago
:::::: commit date: 4 hours ago

Please take the patch only if it's a positive warning. Thanks!

 userfaultfd.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

--- a/mm/userfaultfd.c
+++ b/mm/userfaultfd.c
@@ -826,9 +826,7 @@ static int remap_pages_pte(struct mm_str
 		WRITE_ONCE(src_page->index, linear_page_index(dst_vma,
 							      dst_addr));
 
-		if (!pte_same(ptep_clear_flush(src_vma, src_addr, src_pte),
-			      orig_src_pte))
-			BUG();
+		BUG_ON(!pte_same(ptep_clear_flush(src_vma, src_addr, src_pte), orig_src_pte));
 
 		orig_dst_pte = mk_pte(src_page, dst_vma->vm_page_prot);
 		orig_dst_pte = maybe_mkwrite(pte_mkdirty(orig_dst_pte),
@@ -878,9 +876,7 @@ static int remap_pages_pte(struct mm_str
 			return -EAGAIN;
 		}
 
-		if (pte_val(ptep_get_and_clear(src_mm, src_addr, src_pte)) !=
-		    pte_val(orig_src_pte))
-			BUG();
+		BUG_ON(pte_val(ptep_get_and_clear(src_mm, src_addr, src_pte)) != pte_val(orig_src_pte));
 		set_pte_at(dst_mm, dst_addr, dst_pte, orig_src_pte);
 
 		if (dst_mm != src_mm) {

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

* [PATCH] userfaultfd: fix bugon.cocci warnings
  2021-01-10  2:27 [aa:master 6/14] mm/huge_memory.c:1989:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG kernel test robot
  2021-01-10  2:27 ` [PATCH] userfaultfd: fix bugon.cocci warnings kernel test robot
@ 2021-01-10  2:27 ` kernel test robot
  1 sibling, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-01-10  2:27 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
TO: Andrea Arcangeli <aarcange@redhat.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

mm/huge_memory.c:1989: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: f2c575d5972c ("userfaultfd: UFFDIO_REMAP uABI")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/andrea/aa.git master
head:   fc5a76b1c14e5e6cdc64ece306fc03773662d98a
commit: f2c575d5972c6714297bcdef981f388c499267c1 [6/14] userfaultfd: UFFDIO_REMAP uABI
:::::: branch date: 
:::::: commit date: 7 hours ago

Please take the patch only if it's a positive warning. Thanks!

 huge_memory.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1984,9 +1984,7 @@ int remap_pages_huge_pmd(struct mm_struc
 	WRITE_ONCE(src_page->mapping, (struct address_space *) dst_anon_vma);
 	WRITE_ONCE(src_page->index, linear_page_index(dst_vma, dst_addr));
 
-	if (!pmd_same(pmdp_huge_clear_flush(src_vma, src_addr, src_pmd),
-		      src_pmdval))
-		BUG();
+	BUG_ON(!pmd_same(pmdp_huge_clear_flush(src_vma, src_addr, src_pmd), src_pmdval));
 	_dst_pmd = mk_huge_pmd(src_page, dst_vma->vm_page_prot);
 	_dst_pmd = maybe_pmd_mkwrite(pmd_mkdirty(_dst_pmd), dst_vma);
 	set_pmd_at(dst_mm, dst_addr, dst_pmd, _dst_pmd);

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

* [PATCH] userfaultfd: fix bugon.cocci warnings
  2021-01-10  2:27 [aa:master 6/14] mm/huge_memory.c:1989:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG kernel test robot
@ 2021-01-10  2:27 ` kernel test robot
  2021-01-10  2:27 ` kernel test robot
  1 sibling, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-01-10  2:27 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
TO: Andrea Arcangeli <aarcange@redhat.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

mm/userfaultfd.c:831: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)
mm/userfaultfd.c:883: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: f2c575d5972c ("userfaultfd: UFFDIO_REMAP uABI")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/andrea/aa.git master
head:   fc5a76b1c14e5e6cdc64ece306fc03773662d98a
commit: f2c575d5972c6714297bcdef981f388c499267c1 [6/14] userfaultfd: UFFDIO_REMAP uABI
:::::: branch date: 
:::::: commit date: 7 hours ago

Please take the patch only if it's a positive warning. Thanks!

 userfaultfd.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

--- a/mm/userfaultfd.c
+++ b/mm/userfaultfd.c
@@ -826,9 +826,7 @@ static int remap_pages_pte(struct mm_str
 		WRITE_ONCE(src_page->index, linear_page_index(dst_vma,
 							      dst_addr));
 
-		if (!pte_same(ptep_clear_flush(src_vma, src_addr, src_pte),
-			      orig_src_pte))
-			BUG();
+		BUG_ON(!pte_same(ptep_clear_flush(src_vma, src_addr, src_pte), orig_src_pte));
 
 		orig_dst_pte = mk_pte(src_page, dst_vma->vm_page_prot);
 		orig_dst_pte = maybe_mkwrite(pte_mkdirty(orig_dst_pte),
@@ -878,9 +876,7 @@ static int remap_pages_pte(struct mm_str
 			return -EAGAIN;
 		}
 
-		if (pte_val(ptep_get_and_clear(src_mm, src_addr, src_pte)) !=
-		    pte_val(orig_src_pte))
-			BUG();
+		BUG_ON(pte_val(ptep_get_and_clear(src_mm, src_addr, src_pte)) != pte_val(orig_src_pte));
 		set_pte_at(dst_mm, dst_addr, dst_pte, orig_src_pte);
 
 		if (dst_mm != src_mm) {

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

end of thread, other threads:[~2021-12-23  2:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-07  3:40 [aa:master 33/37] mm/huge_memory.c:2062:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG kernel test robot
2021-05-07  3:40 ` [PATCH] userfaultfd: fix bugon.cocci warnings kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2021-12-23  2:47 kernel test robot
2021-12-23  2:47 kernel test robot
2021-09-20 18:53 [andrea-aa:main 34/39] mm/userfaultfd.c:866:3-6: WARNING: Use BUG_ON instead of if condition followed by BUG kernel test robot
2021-09-20 18:53 ` [PATCH] userfaultfd: fix bugon.cocci warnings kernel test robot
2021-05-07  2:49 [aa:master 33/37] mm/userfaultfd.c:831:3-6: WARNING: Use BUG_ON instead of if condition followed by BUG kernel test robot
2021-05-07  2:49 ` [PATCH] userfaultfd: fix bugon.cocci warnings kernel test robot
2021-01-10  2:27 [aa:master 6/14] mm/huge_memory.c:1989:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG kernel test robot
2021-01-10  2:27 ` [PATCH] userfaultfd: fix bugon.cocci warnings kernel test robot
2021-01-10  2:27 ` 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.