summaryrefslogtreecommitdiff
path: root/scripts/mod
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2019-10-29 21:38:09 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2019-11-11 20:10:01 +0900
commit76b54cf033c9f2effc70066a2bbb2331013889a1 (patch)
treea7df19ce2617fb722e7f9e7b72756d109eec0fc1 /scripts/mod
parentbc35d4bda205d85bf8f87bb013a59afb6b87bc89 (diff)
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.c6
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;