modpost: remove unneeded local variable in contains_namespace()
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 29 Oct 2019 12:38:09 +0000 (21:38 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Mon, 11 Nov 2019 11:10:01 +0000 (20:10 +0900)
The local variable, ns_entry, is unneeded.

While I was here, I also cleaned up the comparison with NULL or 0.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Matthias Maennich <maennich@google.com>
scripts/mod/modpost.c

index 2cdbcdf..46d7f69 100644 (file)
@@ -239,10 +239,8 @@ static struct symbol *find_symbol(const char *name)
 static bool contains_namespace(struct namespace_list *list,
                               const char *namespace)
 {
-       struct namespace_list *ns_entry;
-
-       for (ns_entry = list; ns_entry != NULL; ns_entry = ns_entry->next)
-               if (strcmp(ns_entry->namespace, namespace) == 0)
+       for (; list; list = list->next)
+               if (!strcmp(list->namespace, namespace))
                        return true;
 
        return false;