History

scripts/nsdeps: get 'make nsdeps' working again

Since commit cdd30ebb1b9f ("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.

Masahiro Yamada committed 1 year ago

Commit 62aa6f21 parent cdd30eb2 files · +3 −3Browse files

Unified · Split

2 files
  1. scripts/coccinelle/misc/add_namespace.cocci +2 −2
  2. scripts/nsdeps +1 −1
scripts/coccinelle/misc/add_namespace.cocci+2−2
@@ -13,7 +13,7 @@ virtual report · 12 unmodified lines
13declarer name MODULE_IMPORT_NS;13declarer name MODULE_IMPORT_NS;
14identifier virtual.ns;14identifier virtual.ns;
15@@15@@
16MODULE_IMPORT_NS("ns");16MODULE_IMPORT_NS(ns);
17 17
18// Add missing imports, but only adjacent to a MODULE_LICENSE statement.18// Add missing imports, but only adjacent to a MODULE_LICENSE statement.
19// That ensures we are adding it only to the main module source file.19// That ensures we are adding it only to the main module source file.
@@ -23,7 +23,7 @@ expression license; · 3 unmodified lines
23identifier virtual.ns;23identifier virtual.ns;
24@@24@@
25MODULE_LICENSE(license);25MODULE_LICENSE(license);
26+ MODULE_IMPORT_NS("ns");26+ MODULE_IMPORT_NS(ns);
27 27
28// Dummy rule for report mode that would otherwise be empty and make spatch28// Dummy rule for report mode that would otherwise be empty and make spatch
29// fail ("No rules apply.")29// fail ("No rules apply.")
scripts/nsdeps+1−1
@@ -21,7 +21,7 @@ fi · 20 unmodified lines
21 21
22generate_deps_for_ns() {22generate_deps_for_ns() {
23 $SPATCH --very-quiet --in-place --sp-file \23 $SPATCH --very-quiet --in-place --sp-file \
24 $srctree/scripts/coccinelle/misc/add_namespace.cocci -D nsdeps -D ns=$1 $224 $srctree/scripts/coccinelle/misc/add_namespace.cocci -D nsdeps -D ns=\"$1\" $2
25}25}
26 26
27generate_deps() {27generate_deps() {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t