Skip to content

Commit fcf22a9

Browse files
ukleinekJonathan Corbet
authored andcommitted
doc: module: DEFAULT_SYMBOL_NAMESPACE must be defined before #includes
The definition of EXPORT_SYMBOL et al depends on DEFAULT_SYMBOL_NAMESPACE. So DEFAULT_SYMBOL_NAMESPACE must already be available when <linux/export.h> is parsed. Also when defined that early there is no need for an #undef, so drop that from the usage example. Reported-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/linux-i2c/[email protected]/ Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/3dd7ff6fa0a636de86e091286016be8c90e03631.1733305665.git.ukleinek@kernel.org Signed-off-by: Jonathan Corbet <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 3008178 commit fcf22a9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Documentation/core-api/symbol-namespaces.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,10 @@ as this argument has preference over a default symbol namespace.
7878
A second option to define the default namespace is directly in the compilation
7979
unit as preprocessor statement. The above example would then read::
8080

81-
#undef DEFAULT_SYMBOL_NAMESPACE
8281
#define DEFAULT_SYMBOL_NAMESPACE "USB_COMMON"
8382

84-
within the corresponding compilation unit before any EXPORT_SYMBOL macro is
85-
used.
83+
within the corresponding compilation unit before the #include for
84+
<linux/export.h>. Typically it's placed before the first #include statement.
8685

8786
3. How to use Symbols exported in Namespaces
8887
============================================

0 commit comments

Comments
 (0)