modpost: check forbidden MODULE_IMPORT_NS("module:") at compile time
authorMasahiro Yamada <masahiroy@kernel.org>
Thu, 22 May 2025 07:17:20 +0000 (16:17 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Sun, 25 May 2025 09:15:51 +0000 (18:15 +0900)
commit9c036cfbb75bb58ecce589f547fdb8af153493a6
treec51677e34ed86660d92a380df8a5234788f6062f
parent8f81d8529e19c84b014e4239d2012373274d138d
modpost: check forbidden MODULE_IMPORT_NS("module:") at compile time

Explicitly adding MODULE_IMPORT_NS("module:...") is not allowed.

Currently, this is only checked at run time. That is, when such a
module is loaded, an error message like the following is shown:

  foo: module tries to import module namespace: module:bar

Obviously, checking this at compile time improves usability.

In such a case, modpost will report the following error at compile time:

  ERROR: modpost: foo: explicitly importing namespace "module:bar" is not allowed.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/mod/modpost.c