[U-Boot] [PATCH 4/8] dm: core: remove unnecessary return condition in uclass lookup

Masahiro Yamada yamada.m at jp.panasonic.com
Mon Nov 17 09:19:41 CET 2014


These conditions never happen.
 - There is no real uclass with UCLASS_INVALID id.
 - uclass never becomes NULL because ll_entry_start() always returns
   a valid pointer.

Signed-off-by: Masahiro Yamada <yamada.m at jp.panasonic.com>
---

 drivers/core/lists.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/core/lists.c b/drivers/core/lists.c
index 0c58ec4..ddbac38 100644
--- a/drivers/core/lists.c
+++ b/drivers/core/lists.c
@@ -41,9 +41,6 @@ struct uclass_driver *lists_uclass_lookup(enum uclass_id id)
 	const int n_ents = ll_entry_count(struct uclass_driver, uclass);
 	struct uclass_driver *entry;
 
-	if ((id == UCLASS_INVALID) || !uclass)
-		return NULL;
-
 	for (entry = uclass; entry != uclass + n_ents; entry++) {
 		if (entry->id == id)
 			return entry;
-- 
1.9.1



More information about the U-Boot mailing list