[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191028151427.31612-3-jeyu@kernel.org>
Date: Mon, 28 Oct 2019 16:14:26 +0100
From: Jessica Yu <jeyu@...nel.org>
To: linux-kernel@...r.kernel.org
Cc: Matthias Maennich <maennich@...gle.com>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
Jessica Yu <jeyu@...nel.org>
Subject: [PATCH 3/4] nsdeps: remove stale .ns_deps files before generating new ones
When adding or removing namespaces, calling `make` does not necessarily
remove existing stale .ns_deps files. That is, one could remove a
namespace, call make, and while modpost writes the correct, new .ns_deps
files, stale ones are not removed from the source tree, thus producing
incorrect results when running `make nsdeps`, i.e., inserting
MODULE_IMPORT_NS() statements for namespaces that have been removed.
Clean up old .ns_deps files before generating new ones with modpost.
Signed-off-by: Jessica Yu <jeyu@...nel.org>
---
Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Makefile b/Makefile
index ffd7a912fc46..22f9894b346b 100644
--- a/Makefile
+++ b/Makefile
@@ -1685,6 +1685,8 @@ tags TAGS cscope gtags: FORCE
PHONY += nsdeps
nsdeps: modules
+ @find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
+ -name '*.ns_deps' -type f -print | xargs rm -f
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost nsdeps
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/$@
--
2.16.4
Powered by blists - more mailing lists