Skip to content

Commit

Permalink
modpost: remove unneeded local variable in contains_namespace()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Masahiro Yamada committed Nov 11, 2019
1 parent bc35d4b commit 76b54cf
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions scripts/mod/modpost.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 76b54cf

Please sign in to comment.