dm: simplify the loop in lists_driver_lookup_name()
authorMasahiro Yamada <yamada.m@jp.panasonic.com>
Sun, 28 Sep 2014 13:52:27 +0000 (22:52 +0900)
committerSimon Glass <sjg@chromium.org>
Wed, 22 Oct 2014 16:32:16 +0000 (10:32 -0600)
commit2cede453dadae5bacd9c659704029bf81e7b06a0
tree84f71c4c9320e81c4e062f973090783f4c3bf6e9
parent29a1bedbf33d788646b51391bb116e481b9f0b45
dm: simplify the loop in lists_driver_lookup_name()

if (strncmp(name, entry->name, len))
                continue;

        /* Full match */
        if (len == strlen(entry->name))
                return entry;

is equivalent to:

        if (!strcmp(name, entry->name))
                return entry;

The latter is simpler.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
drivers/core/lists.c