Skip to content

Commit 62aa6f2

Browse files
masahir0ytorvalds
authored andcommitted
scripts/nsdeps: get 'make nsdeps' working again
Since commit cdd30eb ("module: Convert symbol namespace to string literal"), when MODULE_IMPORT_NS() is missing, 'make nsdeps' inserts pointless code: MODULE_IMPORT_NS("ns"); Here, "ns" is not a namespace, but the variable in the semantic patch. It must not be quoted. Instead, a string literal must be passed to Coccinelle. Fixes: cdd30eb ("module: Convert symbol namespace to string literal") Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent cdd30eb commit 62aa6f2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

scripts/coccinelle/misc/add_namespace.cocci

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ virtual report
1313
declarer name MODULE_IMPORT_NS;
1414
identifier virtual.ns;
1515
@@
16-
MODULE_IMPORT_NS("ns");
16+
MODULE_IMPORT_NS(ns);
1717

1818
// Add missing imports, but only adjacent to a MODULE_LICENSE statement.
1919
// That ensures we are adding it only to the main module source file.
@@ -23,7 +23,7 @@ expression license;
2323
identifier virtual.ns;
2424
@@
2525
MODULE_LICENSE(license);
26-
+ MODULE_IMPORT_NS("ns");
26+
+ MODULE_IMPORT_NS(ns);
2727

2828
// Dummy rule for report mode that would otherwise be empty and make spatch
2929
// fail ("No rules apply.")

scripts/nsdeps

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fi
2121

2222
generate_deps_for_ns() {
2323
$SPATCH --very-quiet --in-place --sp-file \
24-
$srctree/scripts/coccinelle/misc/add_namespace.cocci -D nsdeps -D ns=$1 $2
24+
$srctree/scripts/coccinelle/misc/add_namespace.cocci -D nsdeps -D ns=\"$1\" $2
2525
}
2626

2727
generate_deps() {

0 commit comments

Comments
 (0)