1 // SPDX-License-Identifier: GPL-2.0-only 1 // SPDX-License-Identifier: GPL-2.0-only 2 // 2 // 3 /// Adds missing MODULE_IMPORT_NS statements t 3 /// Adds missing MODULE_IMPORT_NS statements to source files 4 /// 4 /// 5 /// This script is usually called from scripts 5 /// This script is usually called from scripts/nsdeps with -D ns=<namespace> to 6 /// add a missing namespace tag to a module so 6 /// add a missing namespace tag to a module source file. 7 /// 7 /// 8 8 9 virtual nsdeps 9 virtual nsdeps 10 virtual report 10 virtual report 11 11 12 @has_ns_import@ 12 @has_ns_import@ 13 declarer name MODULE_IMPORT_NS; 13 declarer name MODULE_IMPORT_NS; 14 identifier virtual.ns; 14 identifier virtual.ns; 15 @@ 15 @@ 16 MODULE_IMPORT_NS(ns); 16 MODULE_IMPORT_NS(ns); 17 17 18 // Add missing imports, but only adjacent to a 18 // Add missing imports, but only adjacent to a MODULE_LICENSE statement. 19 // That ensures we are adding it only to the m 19 // That ensures we are adding it only to the main module source file. 20 @do_import depends on !has_ns_import && nsdeps 20 @do_import depends on !has_ns_import && nsdeps@ 21 declarer name MODULE_LICENSE; 21 declarer name MODULE_LICENSE; 22 expression license; 22 expression license; 23 identifier virtual.ns; 23 identifier virtual.ns; 24 @@ 24 @@ 25 MODULE_LICENSE(license); 25 MODULE_LICENSE(license); 26 + MODULE_IMPORT_NS(ns); 26 + MODULE_IMPORT_NS(ns); 27 27 28 // Dummy rule for report mode that would other 28 // Dummy rule for report mode that would otherwise be empty and make spatch 29 // fail ("No rules apply.") 29 // fail ("No rules apply.") 30 @script:python depends on report@ 30 @script:python depends on report@ 31 @@ 31 @@
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.