Skip to content

Commit 76b54cf

Browse files
committed
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>
1 parent bc35d4b commit 76b54cf

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎scripts/mod/modpost.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,8 @@ static struct symbol *find_symbol(const char *name)
239239
static bool contains_namespace(struct namespace_list *list,
240240
const char *namespace)
241241
{
242-
struct namespace_list *ns_entry;
243-
244-
for (ns_entry = list; ns_entry != NULL; ns_entry = ns_entry->next)
245-
if (strcmp(ns_entry->namespace, namespace) == 0)
242+
for (; list; list = list->next)
243+
if (!strcmp(list->namespace, namespace))
246244
return true;
247245

248246
return false;

0 commit comments

Comments
 (0)