All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: linux-kbuild@vger.kernel.org
Cc: Jessica Yu <jeyu@kernel.org>,
	Matthias Kaehlcke <mka@chromium.org>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Michal Marek <michal.lkml@markovi.net>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 4/4] mospost: remove unneeded local variable in contains_namespace()
Date: Tue, 29 Oct 2019 21:38:09 +0900	[thread overview]
Message-ID: <20191029123809.29301-5-yamada.masahiro@socionext.com> (raw)
In-Reply-To: <20191029123809.29301-1-yamada.masahiro@socionext.com>

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>
---

 scripts/mod/modpost.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index f7425f5d4ab0..f70b924f379f 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;
-- 
2.17.1


  parent reply	other threads:[~2019-10-29 12:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-29 12:38 [PATCH 0/4] More nsdeps improvements Masahiro Yamada
2019-10-29 12:38 ` [PATCH 1/4] modpost: do not invoke extra modpost for nsdeps Masahiro Yamada
2019-11-05 16:37   ` Matthias Maennich
2019-10-29 12:38 ` [PATCH 2/4] modpost: dump missing namespaces into a single modules.nsdeps file Masahiro Yamada
2019-10-30 20:11   ` Jessica Yu
2019-10-31 11:20   ` Jessica Yu
2019-10-31 11:53     ` Masahiro Yamada
2019-11-06 15:24       ` Matthias Maennich
2019-10-29 12:38 ` [PATCH 3/4] scripts/nsdeps: support nsdeps for external module builds Masahiro Yamada
2019-10-30 17:02   ` Jessica Yu
2019-11-06 16:12   ` Matthias Maennich
2019-10-29 12:38 ` Masahiro Yamada [this message]
2019-11-05 13:47   ` [PATCH 4/4] mospost: remove unneeded local variable in contains_namespace() Matthias Maennich
2019-11-06 15:39   ` Masahiro Yamada
2019-10-30 20:14 ` [PATCH 0/4] More nsdeps improvements Jessica Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191029123809.29301-5-yamada.masahiro@socionext.com \
    --to=yamada.masahiro@socionext.com \
    --cc=jeyu@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=mka@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.