linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>
Cc: Jessica Yu <jeyu@kernel.org>,
	Matthias Kaehlcke <mka@chromium.org>,
	Michal Marek <michal.lkml@markovi.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/4] mospost: remove unneeded local variable in contains_namespace()
Date: Thu, 7 Nov 2019 00:39:08 +0900	[thread overview]
Message-ID: <CAK7LNATq5vK36hs0W3Ywu7j1xy6FgJxB7E3serAv6B1LmVA-nA@mail.gmail.com> (raw)
In-Reply-To: <20191029123809.29301-5-yamada.masahiro@socionext.com>

On Tue, Oct 29, 2019 at 9:38 PM Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> 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>
> ---

Fixed the typo in the subject ( mospost -> modpost )
and applied to linux-kbuild.


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


-- 
Best Regards
Masahiro Yamada

  parent reply	other threads:[~2019-11-06 15:40 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 ` [PATCH 4/4] mospost: remove unneeded local variable in contains_namespace() Masahiro Yamada
2019-11-05 13:47   ` Matthias Maennich
2019-11-06 15:39   ` Masahiro Yamada [this message]
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=CAK7LNATq5vK36hs0W3Ywu7j1xy6FgJxB7E3serAv6B1LmVA-nA@mail.gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).