aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJessica Yu <jeyu@kernel.org>2019-10-24 10:28:37 +0200
committerJessica Yu <jeyu@kernel.org>2019-10-28 14:54:43 +0100
commit074c6c2e2c6dfa0fa65427aa077f6697e18aa9e6 (patch)
tree4cd26ada3582e05444317543d6ec08d052185816
parent948cd0b8e27ebf7336f7919f180cb32fd240412d (diff)
downloadlinux-modules-linus-staging.tar.gz
scripts/nsdeps: make sure to pass all module source files to spatchmodules-linus-staging
The nsdeps script passes a list of the module source files to generate_deps_for_ns() as a space delimited string named $mod_source_files, which then passes it to spatch. But since $mod_source_files is not encased in quotes, each source file in that string is treated as a separate shell function argument (as $2, $3, $4, etc.). However, the spatch invocation only refers to $2, so only one the first file out of $mod_source_files is processed by spatch. This causes problems (namely, the MODULE_IMPORT_NS() statement doesn't get inserted) when a module is composed of many source files and the "main" module file containing the MODULE_LICENSE() statement is not the first file listed in $mod_source_files. Fix this by encasing $mod_source_files in quotes so that the entirety of the string is treated as a single argument and can be referred to as $2. Signed-off-by: Jessica Yu <jeyu@kernel.org>
-rw-r--r--scripts/nsdeps2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/nsdeps b/scripts/nsdeps
index 9ddcd5cb96b1bd..5055b059a81be9 100644
--- a/scripts/nsdeps
+++ b/scripts/nsdeps
@@ -36,7 +36,7 @@ generate_deps() {
| sed -E "s%(^|\s)([^/][^ ]*)%\1$srctree/\2%g"`
for ns in `cat $ns_deps_file`; do
echo "Adding namespace $ns to module $mod_name (if needed)."
- generate_deps_for_ns $ns $mod_source_files
+ generate_deps_for_ns $ns "$mod_source_files"
# sort the imports
for source_file in $mod_source_files; do
sed '/MODULE_IMPORT_NS/Q' $source_file > ${source_file}.tmp