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

This patch just swap del_usage_link() before add_usage_link().

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
 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-06 12:21 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 ` Corentin Labbe [this message]
2017-06-19 16:26   ` [PATCH v2 1/2] kernel/module.c: Invert add_usage_link and del_usage_link functions Jessica Yu
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=20170606121740.350-2-clabbe.montjoie@gmail.com \
    --to=clabbe.montjoie@gmail.com \
    --cc=jeyu@redhat.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®