diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-10-29 13:38:09 +0100 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-11-11 12:10:01 +0100 |
commit | 76b54cf033c9f2effc70066a2bbb2331013889a1 (patch) | |
tree | a7df19ce2617fb722e7f9e7b72756d109eec0fc1 /scripts/mod | |
parent | scripts/nsdeps: support nsdeps for external module builds (diff) | |
download | linux-76b54cf033c9f2effc70066a2bbb2331013889a1.tar.xz linux-76b54cf033c9f2effc70066a2bbb2331013889a1.zip |
modpost: remove unneeded local variable in contains_namespace()
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>
Diffstat (limited to 'scripts/mod')
-rw-r--r-- | scripts/mod/modpost.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 2cdbcdf197a3..46d7f695fe7f 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -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; |