All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux-next] drivers/xen/xenbus/xenbus_client.c: fix bugon.cocci warnings
@ 2021-08-25  6:24 CGEL
  2021-08-25  6:48 ` SeongJae Park
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: CGEL @ 2021-08-25  6:24 UTC (permalink / raw)
  To: Boris Ostrovsky
  Cc: Juergen Gross, Stefano Stabellini, SeongJae Park,
	Roger Pau Monne, xen-devel, Jing Yangyang, Zeal Robot

From: Jing Yangyang <jing.yangyang@zte.com.cn>

Use BUG_ON instead of a 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>
---
 drivers/xen/xenbus/xenbus_client.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c
index 0cd7289..e8bed1c 100644
--- a/drivers/xen/xenbus/xenbus_client.c
+++ b/drivers/xen/xenbus/xenbus_client.c
@@ -542,8 +542,7 @@ static int __xenbus_map_ring(struct xenbus_device *dev,
 		}
 	}
 
-	if (HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, info->unmap, j))
-		BUG();
+	BUG_ON(HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, info->unmap, j));
 
 	*leaked = false;
 	for (i = 0; i < j; i++) {
@@ -581,8 +580,7 @@ static int xenbus_unmap_ring(struct xenbus_device *dev, grant_handle_t *handles,
 		gnttab_set_unmap_op(&unmap[i], vaddrs[i],
 				    GNTMAP_host_map, handles[i]);
 
-	if (HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, unmap, i))
-		BUG();
+	BUG_ON(HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, unmap, i));
 
 	err = GNTST_okay;
 	for (i = 0; i < nr_handles; i++) {
@@ -778,8 +776,7 @@ static int xenbus_unmap_ring_pv(struct xenbus_device *dev, void *vaddr)
 		unmap[i].handle = node->handles[i];
 	}
 
-	if (HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, unmap, i))
-		BUG();
+	BUG_ON(HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, unmap, i));
 
 	err = GNTST_okay;
 	leaked = false;
-- 
1.8.3.1




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

* Re: [PATCH linux-next] drivers/xen/xenbus/xenbus_client.c: fix bugon.cocci warnings
  2021-08-25  6:24 [PATCH linux-next] drivers/xen/xenbus/xenbus_client.c: fix bugon.cocci warnings CGEL
@ 2021-08-25  6:48 ` SeongJae Park
  2021-08-25 12:54 ` Juergen Gross
  2021-08-30 10:13 ` Juergen Gross
  2 siblings, 0 replies; 4+ messages in thread
From: SeongJae Park @ 2021-08-25  6:48 UTC (permalink / raw)
  To: CGEL
  Cc: Boris Ostrovsky, Juergen Gross, Stefano Stabellini,
	SeongJae Park, Roger Pau Monne, xen-devel, Jing Yangyang,
	Zeal Robot

From: SeongJae Park <sjpark@amazon.de>

On Tue, 24 Aug 2021 23:24:51 -0700 CGEL <cgel.zte@gmail.com> wrote:

> From: Jing Yangyang <jing.yangyang@zte.com.cn>
> 
> Use BUG_ON instead of a 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>

Reviewed-by: SeongJae Park <sjpark@amazon.de>


Thanks,
SJ

[...]


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

* Re: [PATCH linux-next] drivers/xen/xenbus/xenbus_client.c: fix bugon.cocci warnings
  2021-08-25  6:24 [PATCH linux-next] drivers/xen/xenbus/xenbus_client.c: fix bugon.cocci warnings CGEL
  2021-08-25  6:48 ` SeongJae Park
@ 2021-08-25 12:54 ` Juergen Gross
  2021-08-30 10:13 ` Juergen Gross
  2 siblings, 0 replies; 4+ messages in thread
From: Juergen Gross @ 2021-08-25 12:54 UTC (permalink / raw)
  To: CGEL, Boris Ostrovsky
  Cc: Stefano Stabellini, SeongJae Park, Roger Pau Monne, xen-devel,
	Jing Yangyang, Zeal Robot


[-- Attachment #1.1.1: Type: text/plain, Size: 371 bytes --]

On 25.08.21 08:24, CGEL wrote:
> From: Jing Yangyang <jing.yangyang@zte.com.cn>
> 
> Use BUG_ON instead of a 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>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [PATCH linux-next] drivers/xen/xenbus/xenbus_client.c: fix bugon.cocci warnings
  2021-08-25  6:24 [PATCH linux-next] drivers/xen/xenbus/xenbus_client.c: fix bugon.cocci warnings CGEL
  2021-08-25  6:48 ` SeongJae Park
  2021-08-25 12:54 ` Juergen Gross
@ 2021-08-30 10:13 ` Juergen Gross
  2 siblings, 0 replies; 4+ messages in thread
From: Juergen Gross @ 2021-08-30 10:13 UTC (permalink / raw)
  To: CGEL, Boris Ostrovsky
  Cc: Stefano Stabellini, SeongJae Park, Roger Pau Monne, xen-devel,
	Jing Yangyang, Zeal Robot


[-- Attachment #1.1.1: Type: text/plain, Size: 363 bytes --]

On 25.08.21 08:24, CGEL wrote:
> From: Jing Yangyang <jing.yangyang@zte.com.cn>
> 
> Use BUG_ON instead of a 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>

Pushed to xen/tip.git for-linus-5.15


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

end of thread, other threads:[~2021-08-30 10:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-25  6:24 [PATCH linux-next] drivers/xen/xenbus/xenbus_client.c: fix bugon.cocci warnings CGEL
2021-08-25  6:48 ` SeongJae Park
2021-08-25 12:54 ` Juergen Gross
2021-08-30 10:13 ` Juergen Gross

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.