From 76b54cf033c9f2effc70066a2bbb2331013889a1 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 29 Oct 2019 21:38:09 +0900 Subject: 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 Reviewed-by: Matthias Maennich --- scripts/mod/modpost.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'scripts/mod/modpost.c') 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; -- cgit v1.2.3-59-g8ed1b