linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Will Deacon <will@kernel.org>
To: Matthias Maennich <maennich@google.com>
Cc: linux-kernel@vger.kernel.org, kernel-team@android.com,
	Jessica Yu <jeyu@kernel.org>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Martijn Coenen <maco@android.com>,
	Lucas De Marchi <lucas.de.marchi@gmail.com>,
	Shaun Ruffell <sruffell@sruffell.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kbuild@vger.kernel.org, linux-modules@vger.kernel.org
Subject: Re: [PATCH 1/4] modpost: delegate updating namespaces to separate function
Date: Fri, 11 Oct 2019 15:24:27 +0100	[thread overview]
Message-ID: <20191011142426.vwfhw4dtyy4nfzkv@willie-the-truck> (raw)
In-Reply-To: <20191010151443.7399-2-maennich@google.com>

On Thu, Oct 10, 2019 at 04:14:40PM +0100, Matthias Maennich wrote:
> Let the function 'sym_update_namespace' take care of updating the
> namespace for a symbol. While this currently only replaces one single
> location where namespaces are updated, in a following patch, this
> function will get more call sites.
> 
> The function signature is intentionally close to sym_update_crc and
> taking the name by char* seems like unnecessary work as the symbol has
> to be looked up again. In a later patch of this series, this concern
> will be addressed.
> 
> This function ensures that symbol::namespace is either NULL or has a
> valid non-empty value. Previously, the empty string was considered 'no
> namespace' as well and this lead to confusion.
> 
> Signed-off-by: Matthias Maennich <maennich@google.com>
> ---
>  scripts/mod/modpost.c | 21 ++++++++++++++++++---
>  1 file changed, 18 insertions(+), 3 deletions(-)
> 
> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> index 4d2cdb4d71e3..9f5dcdff4d2f 100644
> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -362,6 +362,22 @@ static char *sym_extract_namespace(const char **symname)
>  	return namespace;
>  }
>  
> +static void sym_update_namespace(const char *symname, const char *namespace)
> +{
> +       struct symbol *s = find_symbol(symname);
> +       /* That symbol should have been created earlier and thus this is
> +        * actually an assertion. */
> +       if (!s) {
> +               merror("Could not update namespace(%s) for symbol %s\n",
> +                      namespace, symname);
> +               return;
> +       }
> +
> +       free(s->namespace);
> +       s->namespace =
> +	       namespace && namespace[0] ? NOFAIL(strdup(namespace)) : NULL;
> +}

You made me look up C operator precedence again, but it's fine so:

Acked-by: Will Deacon <will@kernel.org>

Will

  reply	other threads:[~2019-10-11 14:24 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-10 15:14 [PATCH 0/4] export/modpost: avoid renaming __ksymtab entries for symbol namespaces Matthias Maennich
2019-10-10 15:14 ` [PATCH 1/4] modpost: delegate updating namespaces to separate function Matthias Maennich
2019-10-11 14:24   ` Will Deacon [this message]
2019-10-11 15:32   ` Greg Kroah-Hartman
2019-10-12  3:19     ` Masahiro Yamada
2019-10-10 15:14 ` [PATCH 2/4] modpost: make updating the symbol namespace explict Matthias Maennich
2019-10-11 14:24   ` Will Deacon
2019-10-11 15:33   ` Greg Kroah-Hartman
2019-10-12  3:22   ` Masahiro Yamada
2019-10-10 15:14 ` [PATCH 3/4] symbol namespaces: revert to previous __ksymtab name scheme Matthias Maennich
2019-10-11 14:24   ` Will Deacon
2019-10-11 15:33   ` Greg Kroah-Hartman
2019-10-12  3:35   ` Masahiro Yamada
2019-10-10 15:14 ` [PATCH 4/4] export: avoid code duplication in include/linux/export.h Matthias Maennich
2019-10-11 15:31   ` Greg Kroah-Hartman
2019-10-11 15:43     ` Matthias Maennich
2019-10-12  4:25       ` Masahiro Yamada
2019-10-18  9:31 ` [PATCH v2 0/4] export/modpost: avoid renaming __ksymtab entries for symbol namespaces Matthias Maennich
2019-10-18  9:31   ` [PATCH v2 1/4] modpost: delegate updating namespaces to separate function Matthias Maennich
2019-10-18  9:31   ` [PATCH v2 2/4] modpost: make updating the symbol namespace explicit Matthias Maennich
2019-10-18  9:31   ` [PATCH v2 3/4] symbol namespaces: revert to previous __ksymtab name scheme Matthias Maennich
2019-10-18  9:31   ` [PATCH v2 4/4] export: avoid code duplication in include/linux/export.h Matthias Maennich
2019-10-21 13:31   ` [PATCH v2 0/4] export/modpost: avoid renaming __ksymtab entries for symbol namespaces Jessica Yu
2019-10-23 12:22   ` Luis Chamberlain
2019-10-24  9:35     ` Matthias Maennich
2019-10-24 10:24       ` Luis Chamberlain

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=20191011142426.vwfhw4dtyy4nfzkv@willie-the-truck \
    --to=will@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jeyu@kernel.org \
    --cc=kernel-team@android.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=lucas.de.marchi@gmail.com \
    --cc=maco@android.com \
    --cc=maennich@google.com \
    --cc=sruffell@sruffell.net \
    --cc=yamada.masahiro@socionext.com \
    /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).