mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jessica Yu <jeyu@redhat.com>
To: Corentin Labbe <clabbe.montjoie@gmail.com>
Cc: rusty@rustcorp.com.au, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] kernel/module.c: Invert add_usage_link and del_usage_link functions
Date: Mon, 19 Jun 2017 18:26:23 +0200	[thread overview]
Message-ID: <20170619162622.7hbxm6k53f43nooh@redbean> (raw)
In-Reply-To: <20170606121740.350-2-clabbe.montjoie@gmail.com>

+++ Corentin Labbe [06/06/17 14:17 +0200]:
>This patch just swap del_usage_link() before add_usage_link().
>
>Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>

Could you combine this with the 2nd patch? By itself this patch
doesn't tell us much. Additionally, could you explain in the changelog
(of the 2nd patch) why they needed to be swapped (i.e., so
del_usage_links() can be called from add_usage_links()).

Thanks!

Jessica

> kernel/module.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
>diff --git a/kernel/module.c b/kernel/module.c
>index e3e9dbba6a5b..983b81f6d4ba 100644
>--- a/kernel/module.c
>+++ b/kernel/module.c
>@@ -1663,29 +1663,29 @@ static inline void remove_notes_attrs(struct module *mod)
> }
> #endif /* CONFIG_KALLSYMS */
>
>-static void add_usage_links(struct module *mod)
>+static void del_usage_links(struct module *mod)
> {
> #ifdef CONFIG_MODULE_UNLOAD
> 	struct module_use *use;
>-	int nowarn;
>
> 	mutex_lock(&module_mutex);
>-	list_for_each_entry(use, &mod->target_list, target_list) {
>-		nowarn = sysfs_create_link(use->target->holders_dir,
>-					   &mod->mkobj.kobj, mod->name);
>-	}
>+	list_for_each_entry(use, &mod->target_list, target_list)
>+		sysfs_remove_link(use->target->holders_dir, mod->name);
> 	mutex_unlock(&module_mutex);
> #endif
> }
>
>-static void del_usage_links(struct module *mod)
>+static void add_usage_links(struct module *mod)
> {
> #ifdef CONFIG_MODULE_UNLOAD
> 	struct module_use *use;
>+	int nowarn;
>
> 	mutex_lock(&module_mutex);
>-	list_for_each_entry(use, &mod->target_list, target_list)
>-		sysfs_remove_link(use->target->holders_dir, mod->name);
>+	list_for_each_entry(use, &mod->target_list, target_list) {
>+		nowarn = sysfs_create_link(use->target->holders_dir,
>+					   &mod->mkobj.kobj, mod->name);
>+	}
> 	mutex_unlock(&module_mutex);
> #endif
> }
>-- 
>2.13.0
>

  reply	other threads:[~2017-06-19 16:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-06 12:17 [PATCH v2 0/2] suppress warning about unused nowarn variable Corentin Labbe
2017-06-06 12:17 ` [PATCH v2 1/2] kernel/module.c: Invert add_usage_link and del_usage_link functions Corentin Labbe
2017-06-19 16:26   ` Jessica Yu [this message]
2017-06-20  6:45     ` Corentin Labbe
2017-06-26 13:37       ` Jessica Yu
2017-06-06 12:17 ` [PATCH v2 2/2] kernel/module.c: suppress warning about unused nowarn variable Corentin Labbe

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=20170619162622.7hbxm6k53f43nooh@redbean \
    --to=jeyu@redhat.com \
    --cc=clabbe.montjoie@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /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

all inboxes | Powered by JetHome®