[PATCH 02/19] dm: core: Use assert_noisy() in devres

Simon Glass sjg at chromium.org
Mon Dec 30 05:19:11 CET 2019


Use this macros instead of the linux ones, as the output is smaller.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 drivers/core/devres.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/core/devres.c b/drivers/core/devres.c
index f2a19ec61b..a3f915dd73 100644
--- a/drivers/core/devres.c
+++ b/drivers/core/devres.c
@@ -80,7 +80,7 @@ void devres_free(void *res)
 	if (res) {
 		struct devres *dr = container_of(res, struct devres, data);
 
-		BUG_ON(!list_empty(&dr->entry));
+		assert_noisy(list_empty(&dr->entry));
 		kfree(dr);
 	}
 }
@@ -90,7 +90,7 @@ void devres_add(struct udevice *dev, void *res)
 	struct devres *dr = container_of(res, struct devres, data);
 
 	devres_log(dev, dr, "ADD");
-	BUG_ON(!list_empty(&dr->entry));
+	assert_noisy(list_empty(&dr->entry));
 	dr->probe = dev->flags & DM_FLAG_BOUND ? true : false;
 	list_add_tail(&dr->entry, &dev->devres_head);
 }
@@ -254,5 +254,5 @@ void devm_kfree(struct udevice *dev, void *p)
 	int rc;
 
 	rc = devres_destroy(dev, devm_kmalloc_release, devm_kmalloc_match, p);
-	WARN_ON(rc);
+	assert_noisy(!rc);
 }
-- 
2.24.1.735.g03f4e72817-goog



More information about the U-Boot mailing list