mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-18 21:21:37 +00:00
dm: core: remove unnecessary return condition in driver lookup
The variable "drv" never becomes NULL because ll_entry_start() always returns a valid pointer even if there are no entries. The case "n_ents == 0" is covered by the following "for" loop. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
84a7153733
commit
f724e0bba2
1 changed files with 0 additions and 3 deletions
|
@ -25,9 +25,6 @@ struct driver *lists_driver_lookup_name(const char *name)
|
|||
const int n_ents = ll_entry_count(struct driver, driver);
|
||||
struct driver *entry;
|
||||
|
||||
if (!drv || !n_ents)
|
||||
return NULL;
|
||||
|
||||
for (entry = drv; entry != drv + n_ents; entry++) {
|
||||
if (!strcmp(name, entry->name))
|
||||
return entry;
|
||||
|
|
Loading…
Add table
Reference in a new issue